From 8f888ae10e01c370d5be7c013f345be211675dd1 Mon Sep 17 00:00:00 2001 From: rays Date: Mon, 9 Nov 2026 00:04:12 +0000 Subject: [PATCH] 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 --- web/src/util.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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).