Skip to content

Commit

Permalink
fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
lawmicha committed Nov 14, 2023
1 parent f980283 commit b503056
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 b503056

Please sign in to comment.