aboutsummaryrefslogtreecommitdiff
path: root/Hotline/MacApp.swift
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2025-10-28 10:06:33 -0700
committerDustin Mierau <dustin@mierau.me>2025-10-28 10:06:33 -0700
commitc5165d348c1efbcc553b3c31dbeaa23353914fb6 (patch)
tree6ba4121a34c095d1180d3025f59e5a300b533937 /Hotline/MacApp.swift
parentd23d0ad9405c1622569415e6ce16d3768af2936a (diff)
Some state cleanup and banner color caching in ServerState.
Diffstat (limited to 'Hotline/MacApp.swift')
-rw-r--r--Hotline/MacApp.swift16
1 files changed, 1 insertions, 15 deletions
diff --git a/Hotline/MacApp.swift b/Hotline/MacApp.swift
index dd7e190..89db36e 100644
--- a/Hotline/MacApp.swift
+++ b/Hotline/MacApp.swift
@@ -192,26 +192,12 @@ struct Application: App {
.defaultSize(width: 690, height: 760)
.defaultPosition(.center)
.onChange(of: activeServerState) {
- AppState.shared.activeServerState = activeServerState
- }
- .onChange(of: activeHotline) {
- AppState.shared.activeHotline = activeHotline
- }
- .onChange(of: activeHotline?.serverTitle) {
- if let hotline = activeHotline {
- AppState.shared.activeServerName = hotline.serverTitle
- }
- }
- .onChange(of: activeHotline?.bannerImage) {
withAnimation {
- AppState.shared.activeServerBanner = activeHotline?.bannerImage
+ AppState.shared.activeServerState = activeServerState
}
}
.onChange(of: activeHotline) {
AppState.shared.activeHotline = activeHotline
- if let hotline = activeHotline {
- AppState.shared.activeServerName = hotline.serverTitle
- }
}
.commands {
CommandGroup(replacing: .newItem) {