Don't show wallet value until prefs are ready
... because preference might be "Hide wallet = true". This eliminates the gap during login or boot up that temporarily shows the wallet balance. Ticket: 1365
This commit is contained in:
parent
f0f1d0f695
commit
40a59c53d4
2 changed files with 6 additions and 5 deletions
|
@ -3,7 +3,7 @@ import { doClearEmailEntry, doClearPasswordEntry } from 'redux/actions/user';
|
|||
import { doSignOut, doOpenModal } from 'redux/actions/app';
|
||||
import { doClearClaimSearch } from 'redux/actions/claims';
|
||||
import { selectClientSetting } from 'redux/selectors/settings';
|
||||
import { selectGetSyncErrorMessage } from 'redux/selectors/sync';
|
||||
import { selectGetSyncErrorMessage, selectPrefsReady } from 'redux/selectors/sync';
|
||||
import { selectHasNavigated } from 'redux/selectors/app';
|
||||
import { selectTotalBalance, selectBalance } from 'redux/selectors/wallet';
|
||||
import { selectUserVerifiedEmail, selectEmailToVerify, selectUser } from 'redux/selectors/user';
|
||||
|
@ -20,6 +20,7 @@ const select = (state) => ({
|
|||
totalBalance: selectTotalBalance(state),
|
||||
syncError: selectGetSyncErrorMessage(state),
|
||||
user: selectUser(state),
|
||||
prefsReady: selectPrefsReady(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
|
|
|
@ -43,6 +43,7 @@ type Props = {
|
|||
syncError: ?string,
|
||||
totalBalance?: number,
|
||||
user: ?User,
|
||||
prefsReady: boolean,
|
||||
doClearClaimSearch: () => void,
|
||||
clearEmailEntry: () => void,
|
||||
clearPasswordEntry: () => void,
|
||||
|
@ -66,6 +67,7 @@ const Header = (props: Props) => {
|
|||
syncError,
|
||||
totalBalance,
|
||||
user,
|
||||
prefsReady,
|
||||
doClearClaimSearch,
|
||||
clearEmailEntry,
|
||||
clearPasswordEntry,
|
||||
|
@ -152,10 +154,8 @@ const Header = (props: Props) => {
|
|||
navigate={`/$/${PAGES.WALLET}`}
|
||||
className="button--file-action header__navigationItem--balance"
|
||||
label={
|
||||
hideBalance || Number(roundedTotalBalance) === 0
|
||||
? isMobile
|
||||
? __('Wallet')
|
||||
: __('Your Wallet')
|
||||
hideBalance || Number(roundedTotalBalance) === 0 || !prefsReady
|
||||
? __(isMobile ? 'Wallet' : 'Your Wallet')
|
||||
: roundedTotalBalance
|
||||
}
|
||||
icon={ICONS.LBC}
|
||||
|
|
Loading…
Reference in a new issue