fix: menubarextra shows update immediately

This commit is contained in:
Michael Freno
2026-01-09 19:41:49 -05:00
parent ec87520ba6
commit edf2d0115d
9 changed files with 172 additions and 30 deletions

View File

@@ -50,6 +50,9 @@ struct MenuBarContentView: View {
var onQuit: () -> Void
var onOpenSettings: () -> Void
var onOpenSettingsTab: (Int) -> Void
// Force view refresh when timer states change
@State private var refreshID = UUID()
var body: some View {
VStack(alignment: .leading, spacing: 0) {
@@ -167,9 +170,13 @@ struct MenuBarContentView: View {
.padding(.vertical, 8)
}
.frame(width: 300)
.id(refreshID)
.onReceive(NotificationCenter.default.publisher(for: Notification.Name("CloseMenuBarPopover"))) { _ in
dismiss()
}
.onReceive(timerEngine.$timerStates) { _ in
refreshID = UUID()
}
}
private var isPaused: Bool {