mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-11 18:22:49 +01:00
fix: Don't re-render the lock icon nearly as often
This commit is contained in:
parent
f523ec5823
commit
00a56a7930
@ -49,6 +49,8 @@ class _EncryptionButtonState extends State<EncryptionButton> {
|
|||||||
await SimpleDialogs(context).tryRequestWithLoadingDialog(
|
await SimpleDialogs(context).tryRequestWithLoadingDialog(
|
||||||
widget.room.enableEncryption(),
|
widget.room.enableEncryption(),
|
||||||
);
|
);
|
||||||
|
// we want to enable the lock icon
|
||||||
|
setState(() => null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,11 +62,14 @@ class _EncryptionButtonState extends State<EncryptionButton> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
_onSyncSub ??= Matrix.of(context)
|
if (widget.room.encrypted) {
|
||||||
.client
|
_onSyncSub ??= Matrix.of(context)
|
||||||
.onSync
|
.client
|
||||||
.stream
|
.onSync
|
||||||
.listen((s) => setState(() => null));
|
.stream
|
||||||
|
.where((s) => s.deviceLists != null)
|
||||||
|
.listen((s) => setState(() => null));
|
||||||
|
}
|
||||||
return FutureBuilder<List<User>>(
|
return FutureBuilder<List<User>>(
|
||||||
future:
|
future:
|
||||||
widget.room.encrypted ? widget.room.requestParticipants() : null,
|
widget.room.encrypted ? widget.room.requestParticipants() : null,
|
||||||
|
Loading…
Reference in New Issue
Block a user