GPT-5 finding
Global loading flag is toggled concurrently by multiple components, causing flicker and incorrect UI state
mediumconcurrencyhigh
- desktop/renderer/src/components/wallet/WalletSidebarPanel.tsx:31-37
- desktop/renderer/src/components/wallet/WalletSidebarPanel.tsx:53-57
- desktop/renderer/src/components/wallet/WalletView.tsx:137-143
- desktop/renderer/src/components/wallet/WalletView.tsx:183-185
Both WalletSidebarPanel and WalletView call setLoading(true) and setLoading(false) on a shared store. If both refresh concurrently (which they do on mount, and WalletView also polls), one completion can set loading=false while the other is still in flight, yielding a false "not loading" state and UI flicker. This is a race on a shared, non-reference-counted flag.
Recommendation
Use per-component local loading states, or implement an in-flight counter in the store (increment on start, decrement on finish, derived loading = count > 0). Alternatively centralize wallet refresh in a single place and have views subscribe to that state.