Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,18 @@ class PlatformBalanceSyncService: ObservableObject {
/// Perform the actual BLAST address sync via platform-wallet.
func performSync() async {
guard !isSyncing else { return }
// Silent no-op when the active network has no wallet bound
// yet (e.g. the user just switched to a network they
// haven't created a wallet on, or pull-to-refreshed an
// empty Wallets tab). The previous behavior surfaced
// "Platform address wallet not configured" in red, which
// reads like a setup bug rather than the benign empty
// state it actually is. Callers gate their entry points
// (Sync Now button, .refreshable) on the presence of a
// wallet too, so reaching here without one is best-effort
// safety for race-y dispatches.
guard let walletManager = walletManager else {
lastError = "Platform address wallet not configured"
lastError = nil
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,18 @@ var body: some View {
.buttonStyle(.borderedProminent)
.tint(.blue)
.controlSize(.mini)
.disabled(platformBalanceSyncService.isSyncing)
// Disable when there's nothing to sync —
// either an active sync is already in
// flight, or the active network has no
// wallet bound to drive BLAST against. The
// service itself short-circuits to a no-op
// in that second case, but disabling the
// button keeps the UI honest about whether
// a tap will do anything.
.disabled(
platformBalanceSyncService.isSyncing
|| walletManager.firstWallet == nil
)

Button {
platformBalanceSyncService.clearDisplay()
Expand Down
Loading