79f1b1242d
## Ticket lbry-desktop 6841 ## Issue If you are already at the homepage and you click the "Home" or "Odysee" logo again, the entire page reloads, causing the whole startup sequence to re-run (lots of fetches). This can be annoying when not intended (e.g. clicked too many times), as startup is slow for some and we also lose non-persistent Redux data (for debugging). I believe the requirement was just to reload the homepage tiles, as they might be showing stale ones after a while. A full reload was the quick-and-easy fix. ## Approach Best not to touch the complicated `ClaimTilesDiscover`, so just clear the search cache key in this scenario. `ClaimTilesDiscover` will then pick this up and perform a new `claim_search`.
33 lines
1.5 KiB
JavaScript
33 lines
1.5 KiB
JavaScript
import { connect } from 'react-redux';
|
|
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 { selectHasNavigated } from 'redux/selectors/app';
|
|
import { selectTotalBalance, selectBalance } from 'redux/selectors/wallet';
|
|
import { selectUserVerifiedEmail, selectEmailToVerify, selectUser } from 'redux/selectors/user';
|
|
import * as MODALS from 'constants/modal_types';
|
|
import * as SETTINGS from 'constants/settings';
|
|
import Header from './view';
|
|
|
|
const select = (state) => ({
|
|
authenticated: selectUserVerifiedEmail(state),
|
|
balance: selectBalance(state),
|
|
emailToVerify: selectEmailToVerify(state),
|
|
hasNavigated: selectHasNavigated(state),
|
|
hideBalance: selectClientSetting(state, SETTINGS.HIDE_BALANCE),
|
|
totalBalance: selectTotalBalance(state),
|
|
syncError: selectGetSyncErrorMessage(state),
|
|
user: selectUser(state),
|
|
});
|
|
|
|
const perform = (dispatch) => ({
|
|
doClearClaimSearch: () => dispatch(doClearClaimSearch()),
|
|
clearEmailEntry: () => dispatch(doClearEmailEntry()),
|
|
clearPasswordEntry: () => dispatch(doClearPasswordEntry()),
|
|
signOut: () => dispatch(doSignOut()),
|
|
openChangelog: (modalProps) => dispatch(doOpenModal(MODALS.CONFIRM, modalProps)),
|
|
});
|
|
|
|
export default connect(select, perform)(Header);
|