Reload functionality #682
3 changed files with 23 additions and 1 deletions
|
@ -200,11 +200,22 @@ export function doRemoveSnackBarSnack() {
|
|||
export function doClearCache() {
|
||||
return function(dispatch, getState) {
|
||||
window.cacheStore.purge();
|
||||
|
||||
dispatch(doFetchFileInfosAndPublishedClaims());
|
||||
return Promise.resolve();
|
||||
weird, the issue is back ^ 😕 weird, the issue is back ^ :confused:
|
||||
};
|
||||
}
|
||||
|
||||
export function doReloadCurrentPage() {
|
||||
return function(dispatch, getState) {
|
||||
const currentPage = remote.getCurrentWindow();
|
||||
if (currentPage) {
|
||||
dispatch(doClearCache()).then(() => {
|
||||
currentPage.reload();
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function doQuit() {
|
||||
return function(dispatch, getState) {
|
||||
remote.app.quit();
|
||||
|
|
|
@ -6,6 +6,7 @@ import {
|
|||
selectIsForwardDisabled,
|
||||
} from "selectors/navigation";
|
||||
import { selectBalance } from "selectors/wallet";
|
||||
import { doReloadCurrentPage } from "actions/app";
|
||||
import {
|
||||
doNavigate,
|
||||
doHistoryBack,
|
||||
|
@ -24,6 +25,7 @@ const perform = dispatch => ({
|
|||
navigate: path => dispatch(doNavigate(path)),
|
||||
back: () => dispatch(doHistoryBack()),
|
||||
forward: () => dispatch(doHistoryForward()),
|
||||
reload: () => dispatch(doReloadCurrentPage()),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(Header);
|
||||
|
|
|
@ -11,6 +11,7 @@ export const Header = props => {
|
|||
isForwardDisabled,
|
||||
navigate,
|
||||
publish,
|
||||
reload,
|
||||
} = props;
|
||||
return (
|
||||
<header id="header">
|
||||
|
@ -32,6 +33,14 @@ export const Header = props => {
|
|||
title={__("Forward")}
|
||||
/>
|
||||
</div>
|
||||
<div className="header__item">
|
||||
<Link
|
||||
onClick={() => reload()}
|
||||
button="alt button--flat"
|
||||
icon="icon-refresh"
|
||||
title={__("Reload Current Page")}
|
||||
/>
|
||||
</div>
|
||||
<div className="header__item">
|
||||
<Link
|
||||
onClick={() => navigate("/discover")}
|
||||
|
|
Loading…
Reference in a new issue
This fixed the issue with
published
page ^See https://github.com/lbryio/lbry-app/pull/682#issuecomment-337434699