diff --git a/web/kanban.js b/web/kanban.js index b576663..dbae459 100644 --- a/web/kanban.js +++ b/web/kanban.js @@ -513,7 +513,7 @@ async function syncHot(step){ // board load it asks only when something it follows changed; the folder's // own timer always asks, since another computer may have moved the order. async function syncFolder(force=false){ - if(!folderActive()||FOLDER.busy||!board||!may('print'))return; + if(!folderActive()||FOLDER.busy||!board||!may('print')||$('app').hidden)return; // One tab per computer writes the folders: two tabs writing the same file // lock each other out. The other tabs skip the pass. if(navigator.locks&&!force?.held)return navigator.locks.request('dtf-folders',{ifAvailable:true}, @@ -628,6 +628,9 @@ async function syncFolder(force=false){ else if(locked.some(name=>FOLDER.locked.get(name)===1))say('Pastas automáticas: '+FOLDER.error); } }catch(e){ + // The session ended (8 h) or the server is restarting: load() already shows + // the sign-in, and the folders resume after it (Sentry DTF-WEB-N). + if(e.status===401||e.status===503){FOLDER.status='';return;} if(e.name==='NotAllowedError')FOLDER.granted=false; else if(e.name==='NotFoundError')FOLDER.error='A pasta “'+FOLDER.handle?.name+'” não foi encontrada. Ela foi apagada ou a rede caiu? Escolha a pasta de novo.'; else FOLDER.error='A última tentativa falhou: '+e.message+' O Kanban tenta de novo sozinho.';