mirror of
https://github.com/zapstore/zapstore.git
synced 2026-10-05 20:48:24 +00:00
hotfix(trust-dialog): show "Always trust" only when trust can be persisted
The "Always trust" switch was shown using profile availability, which can be null even when the user is signed in, and could also appear when trust could not be saved. Use signer readiness (`activePubkey` + `activeSigner`) as the visibility condition. This makes the dialog behavior consistent with real trust persistence capability.
This commit is contained in:
@@ -36,6 +36,8 @@ class InstallAlertDialog extends HookConsumerWidget {
|
||||
}
|
||||
final trustedSignerNotifier = useState(false);
|
||||
final signedInPubkey = ref.watch(Signer.activePubkeyProvider);
|
||||
final activeSigner = ref.watch(Signer.activeSignerProvider);
|
||||
final canPersistTrust = signedInPubkey != null && activeSigner != null;
|
||||
final theme = Theme.of(context);
|
||||
final baseTextSize = theme.textTheme.bodyMedium?.fontSize ?? 14.0;
|
||||
|
||||
@@ -62,7 +64,7 @@ class InstallAlertDialog extends HookConsumerWidget {
|
||||
size: baseTextSize,
|
||||
),
|
||||
] else ...[
|
||||
signedInPubkey != null
|
||||
canPersistTrust
|
||||
? RelevantWhoFollowContainer(app: app, size: baseTextSize)
|
||||
: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -85,7 +87,7 @@ class InstallAlertDialog extends HookConsumerWidget {
|
||||
],
|
||||
),
|
||||
// Only show "Always trust" when signed in (requires signer to persist)
|
||||
if (signedInPubkey != null) ...[
|
||||
if (canPersistTrust) ...[
|
||||
const Gap(14),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
Reference in New Issue
Block a user