fix: update sound/notification globals in password branch + close AudioContext
Agent review findings: - _soundEnabled/_notificationsEnabled not updated in the password-save early-return branch of saveSettings() — fixed - AudioContext never closed after oscillator finishes — added osc.onended callback to ctx.close() preventing resource accumulation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1059,6 +1059,8 @@ async function saveSettings(andClose){
|
||||
await api('/api/settings',{method:'POST',body:JSON.stringify({...body,_set_password:pw.trim()})});
|
||||
window._sendKey=sendKey||'enter';
|
||||
window._showTokenUsage=showTokenUsage;
|
||||
window._soundEnabled=body.sound_enabled;
|
||||
window._notificationsEnabled=body.notifications_enabled;
|
||||
showToast('Settings saved (password set — login now required)');
|
||||
_settingsDirty=false; _settingsThemeOnOpen=theme;
|
||||
const bar=$('settingsUnsavedBar'); if(bar) bar.style.display='none';
|
||||
|
||||
Reference in New Issue
Block a user