mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-19 17:35:18 +00:00
fix: No client on logout
This commit is contained in:
parent
4b3cd26f68
commit
4ba5e6270b
1 changed files with 3 additions and 0 deletions
|
@ -74,6 +74,9 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||||
widget.clients.indexWhere((client) => client.userID == matrixId);
|
widget.clients.indexWhere((client) => client.userID == matrixId);
|
||||||
|
|
||||||
int get _safeActiveClient {
|
int get _safeActiveClient {
|
||||||
|
if (widget.clients.isEmpty) {
|
||||||
|
widget.clients.add(getLoginClient());
|
||||||
|
}
|
||||||
if (activeClient < 0 || activeClient >= widget.clients.length) {
|
if (activeClient < 0 || activeClient >= widget.clients.length) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue