diff --git a/VoiceInk/PowerMode/ActiveWindowService.swift b/VoiceInk/PowerMode/ActiveWindowService.swift index e5038d4..1a3cc0a 100644 --- a/VoiceInk/PowerMode/ActiveWindowService.swift +++ b/VoiceInk/PowerMode/ActiveWindowService.swift @@ -52,6 +52,10 @@ class ActiveWindowService: ObservableObject { configToApply = PowerModeManager.shared.getConfigurationForApp(bundleIdentifier) } + if configToApply == nil { + configToApply = PowerModeManager.shared.getWildcardConfiguration() + } + if let config = configToApply { await MainActor.run { PowerModeManager.shared.setActiveConfiguration(config) diff --git a/VoiceInk/PowerMode/PowerModeConfig.swift b/VoiceInk/PowerMode/PowerModeConfig.swift index 3cb2a6a..80a68ab 100644 --- a/VoiceInk/PowerMode/PowerModeConfig.swift +++ b/VoiceInk/PowerMode/PowerModeConfig.swift @@ -204,6 +204,17 @@ class PowerModeManager: ObservableObject { return nil } + func getWildcardConfiguration() -> PowerModeConfig? { + for config in configurations.filter({ $0.isEnabled }) { + if let urlConfigs = config.urlConfigs { + if urlConfigs.contains(where: { $0.url == "*" }) { + return config + } + } + } + return nil + } + func enableConfiguration(with id: UUID) { if let index = configurations.firstIndex(where: { $0.id == id }) { configurations[index].isEnabled = true