refactor: Use getCryptoIdentityState to check backup state
This commit is contained in:
parent
5bcdd6d1b0
commit
66566e6901
4 changed files with 22 additions and 40 deletions
|
|
@ -22,7 +22,6 @@ class SettingsView extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final showChatBackupBanner = controller.showChatBackupBanner;
|
||||
final activeRoute = GoRouter.of(
|
||||
context,
|
||||
).routeInformationProvider.value.uri.path;
|
||||
|
|
@ -142,20 +141,13 @@ class SettingsView extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
Divider(color: theme.dividerColor),
|
||||
if (showChatBackupBanner == null)
|
||||
ListTile(
|
||||
leading: const Icon(Icons.backup_outlined),
|
||||
title: Text(L10n.of(context).chatBackup),
|
||||
trailing: const CircularProgressIndicator.adaptive(),
|
||||
)
|
||||
else
|
||||
SwitchListTile.adaptive(
|
||||
controlAffinity: ListTileControlAffinity.trailing,
|
||||
value: controller.showChatBackupBanner == false,
|
||||
secondary: const Icon(Icons.backup_outlined),
|
||||
title: Text(L10n.of(context).chatBackup),
|
||||
onChanged: controller.firstRunBootstrapAction,
|
||||
),
|
||||
SwitchListTile.adaptive(
|
||||
controlAffinity: ListTileControlAffinity.trailing,
|
||||
value: controller.cryptoIdentityConnected == true,
|
||||
secondary: const Icon(Icons.backup_outlined),
|
||||
title: Text(L10n.of(context).chatBackup),
|
||||
onChanged: controller.firstRunBootstrapAction,
|
||||
),
|
||||
Divider(color: theme.dividerColor),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.format_paint_outlined),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue