stackchain-dashboard/frontend/workspace-bootstrap.js
timmy 49bbeadc48
Some checks failed
CI / lint (pull_request) Successful in 2m49s
CI / build-release (pull_request) Successful in 6s
CI / browser-journey (pull_request) Failing after 2m43s
CI / release-candidate (pull_request) Has been skipped
perf: defer mobile workspace bootstrap (Closes #996)
2026-08-17 01:04:20 +00:00

23 lines
750 B
JavaScript

async function loadWorkspace({ document, createLoader = createFeatureLoader }) {
const status = document.querySelector('#my-work-action-status');
const url = document.querySelector(
'meta[name="stackchain-feature-today-timer"]'
)?.content || '';
const loader = createLoader({
document,
urls: { 'today-timer': url },
});
if (status) status.textContent = 'Starting workspace…';
try {
await loader.load('today-timer');
if (status) status.textContent = '';
} catch (error) {
if (status) {
status.textContent =
'Workspace could not load. Check your connection, then reload to retry.';
}
throw error;
}
}
if (typeof module !== 'undefined' && module.exports) module.exports = loadWorkspace;