diff --git a/web/src/util.ts b/web/src/util.ts index 11003be..ec7c78c 100644 --- a/web/src/util.ts +++ b/web/src/util.ts @@ -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).