From 6fc82e0f45cf7fff7e84819144c5df5d37f64e26 Mon Sep 17 00:00:00 2001 From: Henrique Velloso Date: Thu, 12 Feb 2026 16:51:51 -0300 Subject: [PATCH] fix: opdate InstallAlertDialog to conditionally display "Always trust" switch based on user sign-in status --- lib/widgets/install_alert_dialog.dart | 63 ++++++++++++++------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/lib/widgets/install_alert_dialog.dart b/lib/widgets/install_alert_dialog.dart index e0e2f77..366ea2c 100644 --- a/lib/widgets/install_alert_dialog.dart +++ b/lib/widgets/install_alert_dialog.dart @@ -84,37 +84,40 @@ class InstallAlertDialog extends HookConsumerWidget { ), ], ), - const Gap(14), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Switch( - value: trustedSignerNotifier.value, - onChanged: (value) { - trustedSignerNotifier.value = value; - }, - ), - Gap(4), - Expanded( - child: Row( - children: [ - Text( - 'Always trust', - style: theme.textTheme.bodyMedium?.copyWith( - color: theme.colorScheme.onSurface, - ), - ), - Gap(4), - AuthorContainer( - beforeText: '', - profile: publisher, - size: baseTextSize, - ), - ], + // Only show "Always trust" when signed in (requires signer to persist) + if (profile != null) ...[ + const Gap(14), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Switch( + value: trustedSignerNotifier.value, + onChanged: (value) { + trustedSignerNotifier.value = value; + }, ), - ), - ], - ), + Gap(4), + Expanded( + child: Row( + children: [ + Text( + 'Always trust', + style: theme.textTheme.bodyMedium?.copyWith( + color: theme.colorScheme.onSurface, + ), + ), + Gap(4), + AuthorContainer( + beforeText: '', + profile: publisher, + size: baseTextSize, + ), + ], + ), + ), + ], + ), + ], ], ], ),