Skip to content

Commit

Permalink
fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
lawmicha committed Nov 23, 2023
1 parent 17fc03f commit 5527ceb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ extension RealtimeConnectionProviderAsync: AppSyncWebsocketDelegate {
return
}
#if os(watchOS)
AppSyncLogger.debug(
"[RealtimeConnectionProvider] on watchOS, received disconnect."
)
self.updateCallback(event: .error(ConnectionProviderError.connection(
"This API uses low-level networking (websockets). Running on watchOS only works for specific circumstances.",
error)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public class StarscreamAdapter: AppSyncWebsocketProvider {
AppSyncLogger.debug(
"[StarscreamAdapter] Manually send disconnect."
)
self.delegate?.websocketDidDisconnect(provider: self, error: nil)
let error = ConnectionProviderError.connection("WatchOS Error", nil)
delegate?.websocketDidDisconnect(provider: self, error: error)
} else {
AppSyncLogger.debug(
"[StarscreamAdapter] watchOS subscriptions are connected within 3s."
Expand Down

0 comments on commit 5527ceb

Please sign in to comment.