fix: open Week Ahead before account refresh (Refs #1177)
Some checks failed
CI / lint (pull_request) Successful in 3m27s
CI / build-release (pull_request) Successful in 7s
CI / browser-journey (pull_request) Failing after 4m41s
CI / release-candidate (pull_request) Has been skipped

This commit is contained in:
timmy 2026-08-20 11:41:04 +00:00
parent e01681af09
commit a1b4698988

View File

@ -83,8 +83,9 @@ function createWeekPlanWorkflow({controller,qs,getLogin,openPlanner,escapeHtml,e
}
async function open(trigger) {
if(!getLogin()){qs('#my-work-action-status').textContent='Planning is unavailable until your operator identity is restored.';return false;}
trigger.disabled=true;qs('#mobile-week-summary').textContent='Loading Week Ahead…';
try{await controller.load();selectedDate=controller.dates()[0].date;qs('#mobile-week-summary').textContent=controller.summary();openPlanner(trigger);return true;}
trigger.disabled=true;selectedDate=controller.dates()[0].date;renderDates();openPlanner(trigger);
qs('#mobile-week-summary').textContent='Loading Week Ahead…';
try{await controller.load();qs('#mobile-week-summary').textContent=controller.summary();openPlanner(null,false);return true;}
catch(error){qs('#mobile-week-summary').textContent='Unavailable · tap to retry';qs('#my-work-action-status').textContent=(error.message||'Week Ahead is unavailable.')+' Retry when connected.';return false;}
finally{trigger.disabled=false;}
}