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
This commit is contained in:
parent
8e544ad5b9
commit
8e509a7166
2 changed files with 8 additions and 13 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue