Skip to content

Commit

Permalink
fix: api error page (chrisleekr#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
habibalkhabbaz authored Dec 22, 2022
1 parent d987a09 commit 8ed5fcc
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions public/js/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class App extends React.Component {
selectedSortOption: {
sortBy: 'default',
sortByDesc: false,
hideInactive: false,
hideInactive: false
},
searchKeyword: '',
isLoaded: false,
Expand Down Expand Up @@ -138,7 +138,7 @@ class App extends React.Component {
searchKeyword: this.state.searchKeyword,
sortBy: this.state.selectedSortOption.sortBy,
sortByDesc: this.state.selectedSortOption.sortByDesc,
hideInactive: this.state.selectedSortOption.hideInactive,
hideInactive: this.state.selectedSortOption.hideInactive
});
}

Expand Down Expand Up @@ -319,7 +319,7 @@ class App extends React.Component {
let selectedSortOption = {
sortBy: 'default',
sortByDesc: false,
hideInactive: false,
hideInactive: false
};

try {
Expand All @@ -328,7 +328,7 @@ class App extends React.Component {
) || {
sortBy: 'default',
sortByDesc: false,
hideInactive: false,
hideInactive: false
};
} catch (e) {}

Expand Down Expand Up @@ -377,17 +377,21 @@ class App extends React.Component {
return <AppLoading />;
}

if (this.isAccountLoaded() === false) {
return <APIError />;
}

if (this.isLocked()) {
return <LockScreen />;
}

const activeSymbols = (selectedSortOption.hideInactive) ?
symbols.filter( s => s.symbolConfiguration.buy.enabled || s.symbolConfiguration.sell.enabled )
: symbols
if (this.isAccountLoaded() === false) {
return <APIError />;
}

const activeSymbols = selectedSortOption.hideInactive
? symbols.filter(
s =>
s.symbolConfiguration.buy.enabled ||
s.symbolConfiguration.sell.enabled
)
: symbols;

const coinWrappers = activeSymbols.map((symbol, index) => {
return (
Expand Down Expand Up @@ -487,8 +491,8 @@ class App extends React.Component {
totalProfitAndLoss={totalProfitAndLoss}
/>
<OrderStats
orderStats={orderStats}
selectedSortOption={selectedSortOption}
orderStats={orderStats}
selectedSortOption={selectedSortOption}
/>
</div>
<Pagination>{paginationItems}</Pagination>
Expand Down

0 comments on commit 8ed5fcc

Please sign in to comment.