blob: 3fe10f9eacced139a8a92d25acb29f4f43c43b20 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
import SwiftUI
@Observable
class ServerState: Equatable {
var id: UUID = UUID()
var selection: ServerNavigationType
var serverName: String? = nil
var accountsShown: Bool = false
var broadcastShown: Bool = false
// var serverBanner: NSImage? = nil
// var bannerBackgroundColor: Color? = nil
init(selection: ServerNavigationType) {
self.selection = selection
}
static func == (lhs: ServerState, rhs: ServerState) -> Bool {
return lhs.id == rhs.id
}
}
enum ServerNavigationType: Identifiable, Hashable, Equatable {
var id: String {
switch self {
case .chat:
return "Chat"
case .news:
return "News"
case .board:
return "Board"
case .files:
return "Files"
// case .accounts:
// return "Accounts"
case .user(let userID):
return String(userID)
}
}
case chat
case news
case board
case files
// case accounts
case user(userID: UInt16)
}
|