mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-23 06:22:43 +00:00
refactor
This commit is contained in:
1 parent
29d38ed11d
commit
c5d208b402
2 files changed
+12
-5
No files matched your search
@@ -225,11 +225,7 @@ struct NotificationsView: View {
|
||||
let status = try await apiCheckToken(token: token)
|
||||
await MainActor.run {
|
||||
m.tokenStatus = status
|
||||
if [.invalid, .expired].contains(status) {
|
||||
testedSuccess = false
|
||||
} else {
|
||||
testedSuccess = true
|
||||
}
|
||||
testedSuccess = status.testSuccess
|
||||
showAlert(
|
||||
NSLocalizedString("Token status", comment: "alert title"),
|
||||
message: status.rawValue
|
||||
|
||||
@@ -4127,6 +4127,17 @@ public enum NtfTknStatus: String, Decodable, Hashable {
|
||||
case confirmed = "CONFIRMED"
|
||||
case active = "ACTIVE"
|
||||
case expired = "EXPIRED"
|
||||
|
||||
public var testSuccess: Bool {
|
||||
switch self {
|
||||
case .new: true
|
||||
case .registered: true
|
||||
case .invalid: false
|
||||
case .confirmed: true
|
||||
case .active: true
|
||||
case .expired: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public struct SndFileTransfer: Decodable, Hashable {
|
||||
|
||||
Reference in new issue
Block a user