perf: lazy-load pull request workspace (Closes #541)
This commit is contained in:
1 parent
3605c42651
commit
7d4ff1f095
6 files changed
+81
-15
No files matched your search
@@ -36,6 +36,7 @@ function createFeatureLoader({ document, urls, timeoutMs = 10000 }) {
|
||||
async function run(name, elements, callback) {
|
||||
const trigger = elements?.trigger;
|
||||
const status = elements?.status;
|
||||
const retryLabel = elements?.retryLabel || 'Tap New issue to retry.';
|
||||
if (trigger) trigger.disabled = true;
|
||||
if (status) status.textContent = 'Loading ' + name.replace(/-/g, ' ') + '…';
|
||||
try {
|
||||
@@ -45,8 +46,9 @@ function createFeatureLoader({ document, urls, timeoutMs = 10000 }) {
|
||||
return true;
|
||||
} catch (_error) {
|
||||
if (status) {
|
||||
const label = name === 'issue-capture' ? 'Issue capture' : name.replace(/-/g, ' ');
|
||||
status.textContent = label + ' could not load. Tap New issue to retry.';
|
||||
const label = name === 'issue-capture' ? 'Issue capture' :
|
||||
name === 'pull-workflow' ? 'Pull workspace' : name.replace(/-/g, ' ');
|
||||
status.textContent = label + ' could not load. ' + retryLabel;
|
||||
}
|
||||
return false;
|
||||
} finally {
|
||||
|
||||
Reference in new issue
Block a user