chore: Follow up encryption button design
This commit is contained in:
parent
8a64b3630c
commit
50995e57ff
1 changed files with 7 additions and 2 deletions
|
|
@ -21,6 +21,7 @@ class EncryptionButton extends StatelessWidget {
|
||||||
.stream
|
.stream
|
||||||
.where((s) => s.deviceLists != null),
|
.where((s) => s.deviceLists != null),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
|
final shouldBeEncrypted = room.joinRules != JoinRules.public;
|
||||||
return FutureBuilder<EncryptionHealthState>(
|
return FutureBuilder<EncryptionHealthState>(
|
||||||
future: room.encrypted
|
future: room.encrypted
|
||||||
? room.calcEncryptionHealthState()
|
? room.calcEncryptionHealthState()
|
||||||
|
|
@ -46,9 +47,13 @@ class EncryptionButton extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
room.encrypted ? Icons.lock_outlined : Icons.lock_open_outlined,
|
room.encrypted
|
||||||
|
? Icons.lock_outlined
|
||||||
|
: Icons.no_encryption_outlined,
|
||||||
size: 20,
|
size: 20,
|
||||||
color: theme.colorScheme.onSurface,
|
color: (shouldBeEncrypted && !room.encrypted)
|
||||||
|
? theme.colorScheme.error
|
||||||
|
: theme.colorScheme.onSurface,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onPressed: () => context.go('/rooms/${room.id}/encryption'),
|
onPressed: () => context.go('/rooms/${room.id}/encryption'),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue