fixed stale state after logout and replayed or lost share intents
This commit is contained in:
@@ -123,6 +123,15 @@ class ChatBloc
|
||||
/// No-op when the bloc has already moved on to a different token: when
|
||||
/// popping a stacked chat (B over A), A's didPopNext runs setToken(A)
|
||||
/// before B's dispose fires.
|
||||
/// The chat view may still be popping when the sign-out resets this bloc,
|
||||
/// so leaveChat would find no token and the long-poll would keep running.
|
||||
@override
|
||||
Future<void> reset() {
|
||||
_chatViewActive = false;
|
||||
_stopLongPoll();
|
||||
return super.reset();
|
||||
}
|
||||
|
||||
void leaveChat(String fromToken) {
|
||||
if ((innerState?.currentToken ?? '') != fromToken) return;
|
||||
_chatViewActive = false;
|
||||
|
||||
Reference in New Issue
Block a user