aboutsummaryrefslogtreecommitdiff
path: root/Hotline/macOS/Board/MessageBoardView.swift
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2025-11-14 16:02:56 -0800
committerDustin Mierau <dustin@mierau.me>2025-11-14 16:02:56 -0800
commita1ec37248ce36e84cbdb896e226f241f39df8292 (patch)
treead84aba4918fafeb75e4fa761dc97a380760d626 /Hotline/macOS/Board/MessageBoardView.swift
parentda1d7001f5132115bfdbe19cd95e73b04ba76c95 (diff)
Bit more work on error handling.
Diffstat (limited to 'Hotline/macOS/Board/MessageBoardView.swift')
-rw-r--r--Hotline/macOS/Board/MessageBoardView.swift20
1 files changed, 9 insertions, 11 deletions
diff --git a/Hotline/macOS/Board/MessageBoardView.swift b/Hotline/macOS/Board/MessageBoardView.swift
index 710ff20..be039d8 100644
--- a/Hotline/macOS/Board/MessageBoardView.swift
+++ b/Hotline/macOS/Board/MessageBoardView.swift
@@ -8,16 +8,14 @@ struct MessageBoardView: View {
var body: some View {
NavigationStack {
- if self.model.access?.contains(.canReadMessageBoard) != false {
- if self.model.messageBoardLoaded && self.model.messageBoard.isEmpty {
- self.emptyBoardView
- }
- else {
- self.messageBoardView
- }
+ if self.model.access?.contains(.canReadMessageBoard) != true {
+ self.disabledBoardView
+ }
+ else if self.model.messageBoardLoaded && self.model.messageBoard.isEmpty {
+ self.emptyBoardView
}
else {
- self.disabledBoardView
+ self.messageBoardView
}
}
.sheet(isPresented: $composerDisplayed) {
@@ -32,7 +30,7 @@ struct MessageBoardView: View {
} label: {
Image(systemName: "square.and.pencil")
}
- .disabled(self.model.access?.contains(.canPostMessageBoard) == false)
+ .disabled((self.model.access?.contains(.canPostMessageBoard) != true) || (self.model.access?.contains(.canReadMessageBoard) != true))
.help("Post to Message Board")
}
}
@@ -45,9 +43,9 @@ struct MessageBoardView: View {
private var disabledBoardView: some View {
ContentUnavailableView {
- Label("Message Board Disabled", systemImage: "quote.bubble")
+ Label("No Message Board", systemImage: "quote.bubble")
} description: {
- Text("This server has turned off the message board")
+ Text("This server has turned off their message board")
}
}