diff --git a/lib/feature/vault/ui/_secret_recovery/dialogs/on_reject_dialog.dart b/lib/feature/vault/ui/_secret_recovery/dialogs/on_reject_dialog.dart index c87fcfad..0160de6f 100644 --- a/lib/feature/vault/ui/_secret_recovery/dialogs/on_reject_dialog.dart +++ b/lib/feature/vault/ui/_secret_recovery/dialogs/on_reject_dialog.dart @@ -22,7 +22,7 @@ class OnRejectDialog extends StatelessWidget { @override Widget build(BuildContext context) => BottomSheetWidget( icon: const Icon(Icons.cancel, size: 80), - titleString: 'Guardian rejected the recovery of your Secret', + titleString: 'Guardians have rejected your Secret recovery request', textSpan: [ const TextSpan(text: 'Secret Recovery process for '), TextSpan(text: vaultName, style: styleW600), diff --git a/lib/feature/vault/ui/_secret_recovery/pages/discovering_peers_page.dart b/lib/feature/vault/ui/_secret_recovery/pages/discovering_peers_page.dart index 54ce1481..a52eb65a 100644 --- a/lib/feature/vault/ui/_secret_recovery/pages/discovering_peers_page.dart +++ b/lib/feature/vault/ui/_secret_recovery/pages/discovering_peers_page.dart @@ -85,9 +85,13 @@ class _DiscoveringPeersPageState extends State { ? GuardianListTile( guardian: message.peerId, ) - : GuardianListTile.pending( - guardian: message.peerId, - ), + : message.isRejected + ? GuardianListTile.rejected( + guardian: message.peerId, + ) + : GuardianListTile.pending( + guardian: message.peerId, + ), ], ), ), diff --git a/lib/feature/vault/ui/_secret_recovery/vault_secret_recovery_presenter.dart b/lib/feature/vault/ui/_secret_recovery/vault_secret_recovery_presenter.dart index 977cf55f..9d255764 100644 --- a/lib/feature/vault/ui/_secret_recovery/vault_secret_recovery_presenter.dart +++ b/lib/feature/vault/ui/_secret_recovery/vault_secret_recovery_presenter.dart @@ -59,7 +59,8 @@ final class VaultSecretRecoveryPresenter extends VaultSecretPresenterBase { .toList()); requestCompleter.complete(updatedMessage); nextPage(); - } else if (messages.where((e) => e.isRejected).length > vault.redudancy) { + } else if (messages.where((e) => e.isRejected).length > + vault.size - vault.threshold) { stopListenResponse(); requestCompleter.complete(updatedMessage.copyWith( status: MessageStatus.rejected, diff --git a/lib/feature/vault/ui/widgets/guardian_list_tile.dart b/lib/feature/vault/ui/widgets/guardian_list_tile.dart index 11e770f9..50d12085 100644 --- a/lib/feature/vault/ui/widgets/guardian_list_tile.dart +++ b/lib/feature/vault/ui/widgets/guardian_list_tile.dart @@ -43,6 +43,16 @@ class GuardianListTile extends StatelessWidget { subtitle = 'ID: ${guardian.toHexShort()}', leading = const _GuardianPendingIcon(); + GuardianListTile.rejected({ + required PeerId guardian, + super.key, + }) : onTap = null, + onLongPress = null, + isWaiting = false, + title = guardian.name, + subtitle = 'ID: ${guardian.toHexShort()}', + leading = const _GuardianRejectedIcon(); + final bool isWaiting; final Widget? leading; final String title; @@ -103,3 +113,16 @@ class _GuardianPendingIcon extends StatelessWidget { scale: 0.6, ); } + +class _GuardianRejectedIcon extends StatelessWidget { + const _GuardianRejectedIcon(); + + @override + Widget build(BuildContext context) => StyledIcon( + icon: Icons.close, + scale: 0.6, + outlined: true, + color: Theme.of(context).colorScheme.error, + bgColor: Theme.of(context).colorScheme.primary, + ); +}