From 90685390432cb69369d57c9b57e9cb87e9ac863b Mon Sep 17 00:00:00 2001 From: Beingpax Date: Mon, 27 Oct 2025 17:02:03 +0545 Subject: [PATCH] Fix power mode selection UI --- VoiceInk/PowerMode/PowerModePopover.swift | 5 ++++- VoiceInk/Whisper/WhisperState+UI.swift | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/VoiceInk/PowerMode/PowerModePopover.swift b/VoiceInk/PowerMode/PowerModePopover.swift index 61e1fed..e658679 100644 --- a/VoiceInk/PowerMode/PowerModePopover.swift +++ b/VoiceInk/PowerMode/PowerModePopover.swift @@ -56,6 +56,9 @@ struct PowerModePopover: View { .onAppear { selectedConfig = powerModeManager.activeConfiguration } + .onChange(of: powerModeManager.activeConfiguration) { newValue in + selectedConfig = newValue + } } private func applySelectedConfiguration() { @@ -99,4 +102,4 @@ struct PowerModeRow: View { .background(isSelected ? Color.white.opacity(0.1) : Color.clear) .cornerRadius(4) } -} \ No newline at end of file +} diff --git a/VoiceInk/Whisper/WhisperState+UI.swift b/VoiceInk/Whisper/WhisperState+UI.swift index 3ad5623..eae3e21 100644 --- a/VoiceInk/Whisper/WhisperState+UI.swift +++ b/VoiceInk/Whisper/WhisperState+UI.swift @@ -82,6 +82,9 @@ extension WhisperState { if UserDefaults.standard.bool(forKey: PowerModeDefaults.autoRestoreKey) { await PowerModeSessionManager.shared.endSession() + await MainActor.run { + PowerModeManager.shared.setActiveConfiguration(nil) + } } await MainActor.run {