@@ -218,23 +218,41 @@ export function Account({
218
218
return null ;
219
219
}
220
220
221
- const canSend = balance && balance . hasAvailable ;
222
-
223
- const initializingSpinnerText =
224
- ( syncedAddressesCount !== undefined && syncedAddressesCount > 1 ) ? (
225
- '\n' + t ( 'account.syncedAddressesCount' , {
226
- count : syncedAddressesCount . toString ( ) ,
227
- defaultValue : 0 ,
228
- } as any )
229
- ) : '' ;
230
-
231
- const offlineErrorTextLines : string [ ] = [ ] ;
221
+ if ( status . fatalError ) {
222
+ return (
223
+ < Spinner guideExists text = { t ( 'account.fatalError' ) } />
224
+ ) ;
225
+ }
232
226
if ( status . offlineError !== null ) {
227
+ const offlineErrorTextLines : string [ ] = [ ] ;
233
228
offlineErrorTextLines . push ( t ( 'account.reconnecting' ) ) ;
234
229
offlineErrorTextLines . push ( status . offlineError ) ;
235
230
if ( usesProxy ) {
236
231
offlineErrorTextLines . push ( t ( 'account.maybeProxyError' ) ) ;
237
232
}
233
+ return (
234
+ < Spinner guideExists text = { offlineErrorTextLines . join ( '\n' ) } />
235
+ ) ;
236
+ }
237
+ if ( ! status . synced ) {
238
+ const text =
239
+ ( syncedAddressesCount !== undefined && syncedAddressesCount > 1 ) ? (
240
+ '\n' + t ( 'account.syncedAddressesCount' , {
241
+ count : syncedAddressesCount . toString ( ) ,
242
+ defaultValue : 0 ,
243
+ } as any )
244
+ ) : '' ;
245
+
246
+ return (
247
+ < Spinner guideExists text = {
248
+ t ( 'account.initializing' ) + text
249
+ } />
250
+ ) ;
251
+ }
252
+ if ( ! hasDataLoaded ) {
253
+ return (
254
+ < Spinner guideExists text = { '' } />
255
+ ) ;
238
256
}
239
257
240
258
const exchangeBuySupported = supportedExchanges && supportedExchanges . exchanges . length > 0 ;
@@ -250,7 +268,7 @@ export function Account({
250
268
const actionButtonsProps = {
251
269
code,
252
270
coinCode : account . coinCode ,
253
- canSend,
271
+ canSend : balance && balance . hasAvailable ,
254
272
exchangeBuySupported,
255
273
account
256
274
} ;
@@ -303,26 +321,12 @@ export function Account({
303
321
balanceList = { [ balance ] }
304
322
/>
305
323
) }
306
- { ! status . synced || offlineErrorTextLines . length || ! hasDataLoaded || status . fatalError ? (
307
- < Spinner guideExists text = {
308
- ( status . fatalError && t ( 'account.fatalError' ) )
309
- || offlineErrorTextLines . join ( '\n' )
310
- || ( ! status . synced &&
311
- t ( 'account.initializing' )
312
- + initializingSpinnerText
313
- )
314
- || ''
315
- } />
316
- ) : (
317
- < >
318
- { ! isAccountEmpty && < Transactions
319
- accountCode = { code }
320
- handleExport = { exportAccount }
321
- explorerURL = { account . blockExplorerTxPrefix }
322
- transactions = { transactions }
323
- /> }
324
- </ >
325
- ) }
324
+ { ! isAccountEmpty && < Transactions
325
+ accountCode = { code }
326
+ handleExport = { exportAccount }
327
+ explorerURL = { account . blockExplorerTxPrefix }
328
+ transactions = { transactions }
329
+ /> }
326
330
</ div >
327
331
</ div >
328
332
</ div >
0 commit comments