feat: follow any open issue from search (Closes #1303)
This commit is contained in:
1 parent
0a18d1ac0f
commit
29e3f55e07
18 files changed
+88
-34
No files matched your search
@@ -36,7 +36,7 @@
|
||||
'/subscription?kind=' + encodeURIComponent(item.kind);
|
||||
root.searchPreviewSubscriptionOptions = fetchJson => ({
|
||||
load:async detail => {
|
||||
if (!(detail.kind === 'issue' && detail.state === 'open' && detail.claimable)) return detail;
|
||||
if (!(detail.kind === 'issue' && detail.state === 'open')) return detail;
|
||||
const result = await fetchJson(root.searchPreviewSubscriptionPath(detail), {headers:{Accept:'application/json'}});
|
||||
return {...detail, watching:result.watching === true};
|
||||
},
|
||||
@@ -52,7 +52,7 @@
|
||||
'watch-error':(state.error?.message || 'Watch status was not changed.') + ' Retry.',
|
||||
})[state.status] || '';
|
||||
root.renderSearchPreviewWatch = (detail, state, button) => {
|
||||
button.hidden = !(detail.kind === 'issue' && detail.state === 'open' && detail.claimable);
|
||||
button.hidden = !(detail.kind === 'issue' && detail.state === 'open');
|
||||
button.textContent = detail.watching ? 'Stop watching' : 'Watch issue';
|
||||
button.disabled = state.status === 'watching' || state.status === 'unwatching';
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const BASE = new URL('./', self.location.href).pathname;
|
||||
importScripts(BASE + 'static/private-data-registry.js');
|
||||
importScripts(BASE + 'static/background-issue-sync.js');
|
||||
const CACHE = 'stackchain-dashboard-shell-v132';
|
||||
const CACHE = 'stackchain-dashboard-shell-v133';
|
||||
const OFFLINE_LEASE_URL = new URL(BASE + '__offline-session-lease', self.location.origin).href;
|
||||
const OUTAGE_STATUSES = new Set([500, 502, 503, 504]);
|
||||
const NAVIGATION_TIMEOUT_MS = self.__STACKCHAIN_NAVIGATION_TIMEOUT_MS || 4000;
|
||||
|
||||
Reference in new issue
Block a user