From 76821aeec5f1a87ac5746a33989144f533240834 Mon Sep 17 00:00:00 2001 From: NaiJi Date: Tue, 6 Aug 2024 21:18:01 +0400 Subject: [PATCH] fix(backups): Resolve backups encryption key on loading state - Resolves #543 --- lib/logic/bloc/backups/backups_state.dart | 5 +++++ lib/ui/pages/backups/copy_encryption_key_modal.dart | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/logic/bloc/backups/backups_state.dart b/lib/logic/bloc/backups/backups_state.dart index 5c5c92ae..8a1032fc 100644 --- a/lib/logic/bloc/backups/backups_state.dart +++ b/lib/logic/bloc/backups/backups_state.dart @@ -24,6 +24,8 @@ sealed class BackupsState extends Equatable { AutobackupQuotas? get autobackupQuotas => null; + String? get encryptionKey => null; + BackupsState copyWith({required final BackblazeBucket backblazeBucket}); } @@ -114,6 +116,9 @@ class BackupsInitialized extends BackupsState { @override AutobackupQuotas? get autobackupQuotas => _backupConfig?.autobackupQuotas; + @override + String? get encryptionKey => _backupConfig?.encryptionKey; + @override Duration? get autobackupPeriod => _backupConfig?.autobackupPeriod?.inMinutes == 0 diff --git a/lib/ui/pages/backups/copy_encryption_key_modal.dart b/lib/ui/pages/backups/copy_encryption_key_modal.dart index b5ceb2fe..c53b46e7 100644 --- a/lib/ui/pages/backups/copy_encryption_key_modal.dart +++ b/lib/ui/pages/backups/copy_encryption_key_modal.dart @@ -34,7 +34,7 @@ class _CopyEncryptionKeyModalState extends State { @override Widget build(final BuildContext context) { final String? encryptionKey = - context.watch().state.backblazeBucket?.encryptionKey; + context.watch().state.encryptionKey; if (encryptionKey == null) { return ListView( controller: widget.scrollController,