mirror of
https://github.com/zapstore/zapstore.git
synced 2026-10-05 12:38:24 +00:00
hotfix(trust-dialog): gate trust UI by signer readiness and harden reputation lookup
In the install trust dialog, stop using profile availability as signed-in signal. Now we show reputation details and "Always trust" only when both `activePubkey` and `activeSigner` are available, so the UI matches actual trust persistence capability. In reputation lookup, make the provider reactive to signer state (`watch` instead of `read`) and send Vertex DVM params as hex pubkeys (`source` and `target`) to avoid format issues. Also replace raw reputation errors with the user-facing message "Service temporarily unavailable."
This commit is contained in:
@@ -192,9 +192,9 @@ class RelevantWhoFollowContainer extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
AsyncError(:final error) => Center(
|
AsyncError() => Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
error.toString().replaceFirst('Exception: ', ''),
|
'Service temporarily unavailable.',
|
||||||
style: baseStyle,
|
style: baseStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -353,16 +353,18 @@ class RelevantWhoFollowContainer extends HookConsumerWidget {
|
|||||||
final relevantWhoFollowProvider = FutureProvider.autoDispose
|
final relevantWhoFollowProvider = FutureProvider.autoDispose
|
||||||
.family<List<Profile>, ({String to})>((ref, arg) async {
|
.family<List<Profile>, ({String to})>((ref, arg) async {
|
||||||
// Require active signer and profile to submit the request
|
// Require active signer and profile to submit the request
|
||||||
final signer = ref.read(Signer.activeSignerProvider);
|
final signer = ref.watch(Signer.activeSignerProvider);
|
||||||
final pubkey = ref.watch(Signer.activePubkeyProvider);
|
final pubkey = ref.watch(Signer.activePubkeyProvider);
|
||||||
if (signer == null || pubkey == null) {
|
if (signer == null || pubkey == null) {
|
||||||
throw 'Not signed in';
|
throw 'Not signed in';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final targetPubkey = arg.to.decodeShareable();
|
||||||
|
|
||||||
// Build and sign a reputation verification request
|
// Build and sign a reputation verification request
|
||||||
final partial = PartialVerifyReputationRequest(
|
final partial = PartialVerifyReputationRequest(
|
||||||
source: pubkey.encodeShareable(type: 'npub'),
|
source: pubkey,
|
||||||
target: arg.to,
|
target: targetPubkey,
|
||||||
limit: 7,
|
limit: 7,
|
||||||
);
|
);
|
||||||
final request = await partial.signWith(signer);
|
final request = await partial.signWith(signer);
|
||||||
|
|||||||
Reference in New Issue
Block a user