mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-22 17:20:43 +01:00
fix: dispose client subs on logout
This commit is contained in:
parent
74735bbd5d
commit
c136c69ed4
@ -368,6 +368,13 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||||||
});
|
});
|
||||||
onLoginStateChanged[name] ??= c.onLoginStateChanged.stream.listen((state) {
|
onLoginStateChanged[name] ??= c.onLoginStateChanged.stream.listen((state) {
|
||||||
final loggedInWithMultipleClients = widget.clients.length > 1;
|
final loggedInWithMultipleClients = widget.clients.length > 1;
|
||||||
|
if (state != LoginState.loggedIn) {
|
||||||
|
_cancelSubs(c.clientName);
|
||||||
|
widget.router.currentState.to(
|
||||||
|
'/rooms',
|
||||||
|
queryParameters: widget.router.currentState.queryParameters,
|
||||||
|
);
|
||||||
|
}
|
||||||
if (loggedInWithMultipleClients) {
|
if (loggedInWithMultipleClients) {
|
||||||
// TODO: display a nicer toast
|
// TODO: display a nicer toast
|
||||||
showOkAlertDialog(
|
showOkAlertDialog(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user