fix: Clear on logout
This commit is contained in:
parent
86a4f90a5a
commit
adb907bbc4
|
@ -758,6 +758,11 @@ class Client extends MatrixApi {
|
||||||
Logs.error('Error during processing events: ' + e.toString(), s);
|
Logs.error('Error during processing events: ' + e.toString(), s);
|
||||||
onSyncError.add(SdkError(
|
onSyncError.add(SdkError(
|
||||||
exception: e is Exception ? e : Exception(e), stackTrace: s));
|
exception: e is Exception ? e : Exception(e), stackTrace: s));
|
||||||
|
if (e is MatrixException &&
|
||||||
|
e.errcode == MatrixError.M_UNKNOWN_TOKEN.toString().split('.').last) {
|
||||||
|
Logs.warning('The user has been logged out!');
|
||||||
|
clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue