@@ -40,7 +40,6 @@ import { isBitcoinBased } from './utils';
4040import { MultilineMarkup } from '@/utils/markup' ;
4141import { Dialog } from '@/components/dialog/dialog' ;
4242import { A } from '@/components/anchor/anchor' ;
43- import { getConfig } from '@/utils/config' ;
4443import { i18n } from '@/i18n/i18n' ;
4544import { ContentWrapper } from '@/components/contentwrapper/contentwrapper' ;
4645import { GlobalBanners } from '@/components/banners' ;
@@ -51,6 +50,7 @@ import { Button, Input } from '@/components/forms';
5150import { SubTitle } from '@/components/title' ;
5251import { TransactionHistorySkeleton } from '@/routes/account/transaction-history-skeleton' ;
5352import { RatesContext } from '@/contexts/RatesContext' ;
53+ import { OfflineError } from '@/components/banners/offline-error' ;
5454import style from './account.module.css' ;
5555
5656type Props = {
@@ -95,7 +95,6 @@ const RemountAccount = ({
9595 ) ;
9696 const syncedAddressesCount = useSubscribe ( syncAddressesCount ( code ) ) ;
9797 const [ transactions , setTransactions ] = useState < accountApi . TTransactions > ( ) ;
98- const [ usesProxy , setUsesProxy ] = useState < boolean > ( ) ;
9998 const [ detailID , setDetailID ] = useState < accountApi . ITransaction [ 'internalID' ] | null > ( null ) ;
10099 const [ showSearchBar , setShowSearchBar ] = useState < boolean > ( false ) ;
101100 const [ searchTerm , setSearchTerm ] = useState < string > ( '' ) ;
@@ -133,10 +132,6 @@ const RemountAccount = ({
133132 } ) ;
134133 } , [ transactions , debouncedSearchTerm ] ) ;
135134
136- useEffect ( ( ) => {
137- getConfig ( ) . then ( ( { backend } ) => setUsesProxy ( backend . proxy . useProxy ) ) ;
138- } , [ ] ) ;
139-
140135 const onAccountChanged = useCallback ( ( status : accountApi . IStatus | undefined ) => {
141136 if ( status === undefined || status . fatalError ) {
142137 return ;
@@ -190,16 +185,6 @@ const RemountAccount = ({
190185 ) ;
191186 }
192187
193- // Status: offline error
194- const offlineErrorTextLines : string [ ] = [ ] ;
195- if ( status !== undefined && status . offlineError !== null ) {
196- offlineErrorTextLines . push ( t ( 'account.reconnecting' ) ) ;
197- offlineErrorTextLines . push ( status . offlineError ) ;
198- if ( usesProxy ) {
199- offlineErrorTextLines . push ( t ( 'account.maybeProxyError' ) ) ;
200- }
201- }
202-
203188 // Status: not synced
204189 const notSyncedText = ( status !== undefined && ! status . synced && syncedAddressesCount !== undefined && syncedAddressesCount > 1 ) ? (
205190 '\n' + t ( 'account.syncedAddressesCount' , {
@@ -232,13 +217,8 @@ const RemountAccount = ({
232217 < GuidedContent >
233218 < Main >
234219 < ContentWrapper >
220+ < OfflineError error = { status ?. offlineError } />
235221 < GlobalBanners code = { code } devices = { devices } />
236- < Message
237- className = { style . status }
238- hidden = { status === undefined || ! status . offlineError }
239- type = "error" >
240- { offlineErrorTextLines . join ( '\n' ) }
241- </ Message >
242222 < Message
243223 className = { style . status }
244224 hidden = { status === undefined || status . synced || ! ! status . offlineError }
0 commit comments