fix scroll restoration

This commit is contained in:
Sean Yesmunt 2019-10-01 01:17:23 -04:00
parent bbcff99fb3
commit 8e4671e05a
2 changed files with 13 additions and 4 deletions

View file

@ -60,11 +60,14 @@ type Props = {
}; };
function AppRouter(props: Props) { function AppRouter(props: Props) {
const { currentScroll } = props; const {
currentScroll,
location: { pathname },
} = props;
useEffect(() => { useEffect(() => {
window.scrollTo(0, currentScroll); window.scrollTo(0, currentScroll);
}, [currentScroll]); }, [currentScroll, pathname]);
return ( return (
<Switch> <Switch>

View file

@ -712,5 +712,11 @@
"Read More": "Read More", "Read More": "Read More",
"Subscribers": "Subscribers", "Subscribers": "Subscribers",
"Your password is saved in your OS keychain.": "Your password is saved in your OS keychain.", "Your password is saved in your OS keychain.": "Your password is saved in your OS keychain.",
"I want to type it manually": "I want to type it manually" "I want to type it manually": "I want to type it manually",
"Enter a LBRY URL here or search for videos, music, games and more": "Enter a LBRY URL here or search for videos, music, games and more",
"discovery": "discovery",
"Multi-language support is brand new and incomplete. Switching your language may have unintended consequences, like glossolalia.": "Multi-language support is brand new and incomplete. Switching your language may have unintended consequences, like glossolalia.",
"This will add a Support button along side tipping. Similar to tips, supports help %discovery_link% but the LBC is returned to your wallet if revoked. Both also help secure your %vanity_names_link%.": "This will add a Support button along side tipping. Similar to tips, supports help %discovery_link% but the LBC is returned to your wallet if revoked. Both also help secure your %vanity_names_link%.",
"Save Password": "Save Password",
"Automatically unlock your wallet on startup": "Automatically unlock your wallet on startup"
} }