diff options
| author | Dustin Mierau <dustin@mierau.me> | 2024-06-30 17:53:55 -0700 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2024-06-30 17:53:55 -0700 |
| commit | 4682a3f6f48e9602f14c40856d8bb38029c468e1 (patch) | |
| tree | 028c2feb38a10cdedebb1c89ded5cb04a8842035 /Hotline/macOS/HotlinePanelView.swift | |
| parent | 6d6c09fe03be7579228b5ca7cd4f4f468065faea (diff) | |
Fix hide/show of News icon in toolbar window.
Diffstat (limited to 'Hotline/macOS/HotlinePanelView.swift')
| -rw-r--r-- | Hotline/macOS/HotlinePanelView.swift | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/Hotline/macOS/HotlinePanelView.swift b/Hotline/macOS/HotlinePanelView.swift index 991946e..a368459 100644 --- a/Hotline/macOS/HotlinePanelView.swift +++ b/Hotline/macOS/HotlinePanelView.swift @@ -61,21 +61,18 @@ struct HotlinePanelView: View { .disabled(ApplicationState.shared.activeServerState == nil) .help("Message Board") - if let activeHotline = ApplicationState.shared.activeHotline, - activeHotline.serverVersion >= 151 { - Button { - ApplicationState.shared.activeServerState?.selection = .news - } - label: { - Image("Section News") - .resizable() - .scaledToFit() - } - .buttonStyle(.plain) - .frame(width: 20, height: 20) - .disabled(ApplicationState.shared.activeServerState == nil) - .help("News") + Button { + ApplicationState.shared.activeServerState?.selection = .news + } + label: { + Image("Section News") + .resizable() + .scaledToFit() } + .buttonStyle(.plain) + .frame(width: 20, height: 20) + .disabled(ApplicationState.shared.activeServerState == nil || (ApplicationState.shared.activeHotline?.serverVersion ?? 0) < 151) + .help("News") Button { ApplicationState.shared.activeServerState?.selection = .files |