From aa201b1550d8bb7ed442bfe81a8e1f922c16db12 Mon Sep 17 00:00:00 2001 From: wangyichen Date: Sun, 5 Jul 2026 15:55:36 +0800 Subject: [PATCH] chore(#5499): drop redundant post-divider _applyVoiceModePref call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The success branch had two adjacent calls: if(typeof window._applyVoiceModePref==='function') window._applyVoiceModePref(); // pre-divider (the actual fix) _applyComposerFooterVisibilitySettings(); if(typeof window._applyVoiceModePref==='function') window._applyVoiceModePref(); // post-divider (redundant) The post-divider one ran after _applyComposerFooterVisibilitySettings, so it couldn't affect the divider the PR was meant to fix. It looked like a defensive double-tap, but the function is idempotent and the pref source (localStorage) doesn't change between the two synchronous calls — so it was just dead code that made the diff look bigger than the actual semantic change. Drop it. Net PR footprint is now strictly: 'use the window-qualified name and apply once before divider recompute in both IIFE branches.' Re-tested: 26/26 pass on test_issue4598_composer_control_visibility + test_issue1488_composer_voice_buttons. --- static/boot.js | 1 - 1 file changed, 1 deletion(-) diff --git a/static/boot.js b/static/boot.js index 28109c62..ed99427d 100644 --- a/static/boot.js +++ b/static/boot.js @@ -2998,7 +2998,6 @@ window._mirrorSpeechSettingsFromServer=_mirrorSpeechSettingsFromServer; // closure-local to the voice-mode IIFE and not visible here. if(typeof window._applyVoiceModePref==='function') window._applyVoiceModePref(); _applyComposerFooterVisibilitySettings(); - if(typeof window._applyVoiceModePref==='function') window._applyVoiceModePref(); // TTS: apply enabled state on boot so buttons show/hide correctly (#499) if(typeof _applyTtsEnabled==='function') _applyTtsEnabled(localStorage.getItem('hermes-tts-enabled')==='true'); }catch(e){