From 8e509a7166aeaddb99e9f8e552e12a153aff5909 Mon Sep 17 00:00:00 2001 From: Daniel Onyejesi Date: Wed, 25 Mar 2026 19:04:20 -0400 Subject: [PATCH] Remove Firefox speech notice, fix auth.js SSO flow race condition - Remove Firefox speech recognition notice (not needed) - Fix missing closing brace that made speech recognition unreachable - Fix auth.js SSO token handling to prevent brief auth screen flash --- public/js/app.js | 11 +---------- public/js/auth.js | 10 +++++++--- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/public/js/app.js b/public/js/app.js index 4f13818..e775d0a 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -536,16 +536,7 @@ function exportToNextcloud(elementId, docType) { } function createSpeechRecognition() { - if (!(window.SpeechRecognition || window.webkitSpeechRecognition)) { - // Show notice once for browsers without Speech API (Firefox, Safari) - if (!window._speechNoticeShown) { - window._speechNoticeShown = true; - console.warn('[Speech] Browser does not support live transcription (Chrome/Edge required). Server-side transcription will still work.'); - document.addEventListener('recording-started', function() { - showToast('Live preview not available in this browser. Final transcription will work when you stop recording.', 'info'); - }, { once: true }); - } - return null; + if (!(window.SpeechRecognition || window.webkitSpeechRecognition)) return null; var SR = window.SpeechRecognition || window.webkitSpeechRecognition; var rec = new SR(); rec.continuous = true; diff --git a/public/js/auth.js b/public/js/auth.js index 14c53cb..db2dff8 100644 --- a/public/js/auth.js +++ b/public/js/auth.js @@ -68,9 +68,13 @@ document.addEventListener('DOMContentLoaded', function() { }) .catch(function() {}); - var savedToken = ssoToken || localStorage.getItem(TOKEN_KEY); - if (!ssoToken && savedToken) { - // Token exists — verify it silently; auth screen stays hidden during check + var savedToken = localStorage.getItem(TOKEN_KEY); + if (ssoToken) { + // SSO token handled above — do nothing here + } else if (ssoError) { + // SSO error handled above — auth screen already shown + } else if (savedToken) { + // Existing token — verify silently; auth screen stays hidden during check fetch('/api/auth/me', { headers: { 'Authorization': 'Bearer ' + savedToken } })