fix(speech): prevent speech provider config reset on startup by removing premature immediate watcher (#1340)

This commit is contained in:
Liet Blue
2026-03-13 22:38:54 +08:00
committed by GitHub
parent 5d8a0c88fe
commit a1a94371f4
@@ -136,6 +136,10 @@ export const useSpeechStore = defineStore('speech', () => {
// NOTICE: clear stale selection when the currently selected speech provider
// is no longer configured to avoid implicit fallback behavior from persisted state.
// NOTE: Do NOT use { immediate: true } here — providers.ts validates credentials
// asynchronously on startup, so firing immediately would see an empty
// configuredSpeechProvidersMetadata and incorrectly reset activeSpeechProvider
// to 'speech-noop', permanently wiping the persisted selection from localStorage.
if (!configuredProviderIds.includes(activeSpeechProvider.value)) {
activeSpeechProvider.value = 'speech-noop'
activeSpeechModel.value = ''
@@ -143,8 +147,6 @@ export const useSpeechStore = defineStore('speech', () => {
activeSpeechVoice.value = undefined
}
},
{ immediate: true },
)
onMounted(() => {