Fix license status update across app

This commit is contained in:
Beingpax 2025-03-20 17:51:59 +05:45
parent 085d4d3052
commit a35d142adb

View File

@ -511,6 +511,7 @@ class WhisperState: NSObject, ObservableObject, AVAudioRecorderDelegate {
private func setupNotifications() {
NotificationCenter.default.addObserver(self, selector: #selector(handleToggleMiniRecorder), name: .toggleMiniRecorder, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleLicenseStatusChanged), name: .licenseStatusChanged, object: nil)
}
@objc public func handleToggleMiniRecorder() {
@ -532,6 +533,11 @@ class WhisperState: NSObject, ObservableObject, AVAudioRecorderDelegate {
}
}
@objc private func handleLicenseStatusChanged() {
// This will refresh the license state when it changes elsewhere in the app
self.licenseViewModel = LicenseViewModel()
}
private func showRecorderPanel() {
logger.notice("📱 Showing \(self.recorderType) recorder")
if recorderType == "notch" {