Fix missing txoList when balance is 0 (PR_1459)

This commit is contained in:
infinite-persistence 2022-05-05 17:24:25 +08:00
commit a4a20aa8e0
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
3 changed files with 7 additions and 13 deletions

View file

@ -1,9 +1,9 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { selectBalance } from 'redux/selectors/wallet'; import { selectBalance } from 'redux/selectors/wallet';
import Wallet from './view'; import YrblWalletEmpty from './view';
const select = (state) => ({ const select = (state) => ({
balance: selectBalance(state), balance: selectBalance(state),
}); });
export default connect(select, {})(Wallet); export default connect(select)(YrblWalletEmpty);

View file

@ -13,7 +13,7 @@ type Props = {
type?: string, type?: string,
actions?: Node, actions?: Node,
}; };
export default function YrblHelp(props: Props) { export default function YrblWalletEmpty(props: Props) {
const { includeWalletLink = false, type = 'sad' } = props; const { includeWalletLink = false, type = 'sad' } = props;
return ( return (

View file

@ -64,7 +64,6 @@ const WalletPage = (props: Props) => {
} }
push(url); push(url);
} }
// @endif // @endif
const { totalBalance } = props; const { totalBalance } = props;
@ -89,22 +88,17 @@ const WalletPage = (props: Props) => {
<TabPanel> <TabPanel>
<div className="section card-stack"> <div className="section card-stack">
<div className="lbc-transactions"> <div className="lbc-transactions">
{/* if the transactions are loading */}
{loading && ( {loading && (
<div className="main--empty"> <div className="main--empty">
<Spinner delayed /> <Spinner delayed />
</div> </div>
)} )}
{/* when the transactions are finished loading */}
{!loading && ( {!loading && (
<> <>
{showIntro ? ( {showIntro && <YrblWalletEmpty includeWalletLink />}
<YrblWalletEmpty includeWalletLink /> <div className="card-stack">
) : ( <TxoList search={search} />
<div className="card-stack"> </div>
<TxoList search={search} />
</div>
)}
</> </>
)} )}
</div> </div>