diff options
Diffstat (limited to 'makima/ios/Sources/Makima/App/AppState.swift')
| -rw-r--r-- | makima/ios/Sources/Makima/App/AppState.swift | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/makima/ios/Sources/Makima/App/AppState.swift b/makima/ios/Sources/Makima/App/AppState.swift index 806d7d0..1cc6788 100644 --- a/makima/ios/Sources/Makima/App/AppState.swift +++ b/makima/ios/Sources/Makima/App/AppState.swift @@ -7,16 +7,21 @@ final class AppState { let auth: AuthStore var wsStatus: WebSocketStatus = .idle var webSocket: TaskWebSocket? - - /// Pending deep-link to open once the app has finished routing. var pendingDeepLink: DeepLink? init(auth: AuthStore = AuthStore()) { self.auth = auth + + if ScreenshotMode.isEnabled { + auth.seedScreenshotData() + } } - // Lazily create the websocket. Lives for the lifetime of the session. func ensureWebSocket() { + guard !ScreenshotMode.isEnabled else { + wsStatus = .online + return + } guard webSocket == nil, let client = auth.client else { return } let ws = TaskWebSocket(profile: client.profile, apiKey: client.apiKey) ws.onStatusChange = { [weak self] s in Task { @MainActor in self?.wsStatus = s } } |
