Fix power mode selection UI

This commit is contained in:
Beingpax 2025-10-27 17:02:03 +05:45
parent b52cb36bb8
commit 9068539043
2 changed files with 7 additions and 1 deletions

View File

@ -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)
}
}
}

View File

@ -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 {