diff --git a/packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Services/PlatformBalanceSyncService.swift b/packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Services/PlatformBalanceSyncService.swift index 1234d0aa536..f69f46f81b9 100644 --- a/packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Services/PlatformBalanceSyncService.swift +++ b/packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Services/PlatformBalanceSyncService.swift @@ -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 } diff --git a/packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Views/CoreContentView.swift b/packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Views/CoreContentView.swift index c49b1fbb766..47e5a62e42b 100644 --- a/packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Views/CoreContentView.swift +++ b/packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Views/CoreContentView.swift @@ -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()