Admin page: an error toast no longer throws for want of haptic (#436)
toast() calls haptic() on an error since cf0dad7 (#430), and haptic is
native.ts's, which admin.js is not built from: every error toast on the
admin page threw a ReferenceError and showed nothing. Never deployed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -228,7 +228,8 @@ async function share(title: string, url: string, btn?: HTMLElement){
|
||||
function toast(msg: string, bad?: boolean){
|
||||
const t=document.createElement('div'), box=$('#toasts');
|
||||
t.className='toast'+(bad?' bad':''); t.textContent=msg;
|
||||
if(bad) haptic('warn');
|
||||
// haptic is native.ts's, which the admin page's script is not built from (#436).
|
||||
if(bad && typeof haptic==='function') haptic('warn');
|
||||
const go=()=>{t.style.opacity='0';t.style.transition='opacity .3s';setTimeout(()=>t.remove(),320)};
|
||||
// An error stays until it is put away: gone after six seconds, it was easy to miss and could not
|
||||
// be read again (#303).
|
||||
|
||||
Reference in New Issue
Block a user