diff --git a/Sesame/ClientState.swift b/Sesame/ClientState.swift index b7c90d6..9fdae4b 100644 --- a/Sesame/ClientState.swift +++ b/Sesame/ClientState.swift @@ -1,5 +1,6 @@ import Foundation import SwiftUI +import SFSafeSymbols enum ConnectionError { case serverNotReached @@ -97,7 +98,8 @@ enum ClientState { self = .openSesame case .messageDeviceInvalid: self = .messageRejected(.invalidDeviceId) - case .noBodyData, .invalidMessageData, .textReceived, .unexpectedSocketEvent: + case .noBodyData, .invalidMessageSize, .textReceived, .unexpectedSocketEvent, .invalidUrlParameter, .invalidResponseAuthentication: + print("Unexpected internal error: \(keyResult)") self = .internalError(keyResult.description) case .deviceNotConnected: self = .deviceNotAvailable(.deviceDisconnected) @@ -242,7 +244,7 @@ extension ClientState { } case .openSesame: return 17 - case .internalError(_): + case .internalError: return 18 } } @@ -294,3 +296,26 @@ extension ClientState { } } } + +extension ClientState { + + @available(iOS 16, *) + var symbol: SFSymbol { + switch self { + case .deviceNotAvailable: + return .wifiExclamationmark + case .internalError: + return .applewatchSlash + case .noKeyAvailable: + return .lockTrianglebadgeExclamationmark + case .openSesame: + return .lockOpen + case .messageRejected: + return .nosign + case .responseRejected: + return .exclamationmarkTriangle + case .requestingStatus, .ready, .waitingForResponse: + return .wifiExclamationmark + } + } +}