ios: fix backgrounding error
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user