23 lines
750 B
JavaScript
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; |