diff --git a/ios/QueueCube/Views/ContentView.swift b/ios/QueueCube/Views/ContentView.swift index 8aa9769..5e232c0 100644 --- a/ios/QueueCube/Views/ContentView.swift +++ b/ios/QueueCube/Views/ContentView.swift @@ -121,9 +121,15 @@ extension ContentView await clearConnectionErrorIfNecessary() await handle(event: event) case .error(let error): + // Ignore if we're in the bg + guard scenePhase == .active else { break } + // Check if this is a backgrounding error (connection abort) - let nsError = error as NSError - let isBackgroundingError = nsError.code == 53 + var isBackgroundingError = false + if case let .websocketError(wsError) = error { + let nsError = wsError as NSError + isBackgroundingError = nsError.code == 53 + } // Only show connection error to user if it's not a backgrounding error if !isBackgroundingError {