Skip to content

Commit

Permalink
fixed background events being called in foreground (#1980)
Browse files Browse the repository at this point in the history
  • Loading branch information
deven98 authored Jul 16, 2024
1 parent f0b162f commit f05bae7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/stream_chat_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
🐞 Fixed

- Fixed null errors in web from markdown.
- Fixed bug causing background events to be sent in foreground.

## 7.3.0

Expand Down
6 changes: 6 additions & 0 deletions packages/stream_chat_flutter_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Upcoming

🐞 Fixed

- Fixed bug causing background events to be sent in foreground.

## 7.3.0

🔄 Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,15 @@ class StreamChatCoreState extends State<StreamChatCore>
return;
}

_eventSubscription?.cancel();
_eventSubscription = client.on().listen(widget.onBackgroundEventReceived);

void onTimerComplete() {
_eventSubscription?.cancel();
client.closeConnection();
}

_disconnectTimer?.cancel();
_disconnectTimer = Timer(widget.backgroundKeepAlive, onTimerComplete);
return;
}
Expand Down

0 comments on commit f05bae7

Please sign in to comment.