Reload functionality #682

Closed
btzr-io wants to merge 5 commits from reload into master
3 changed files with 23 additions and 1 deletions

View file

@ -200,11 +200,22 @@ export function doRemoveSnackBarSnack() {
export function doClearCache() {
return function(dispatch, getState) {
window.cacheStore.purge();
dispatch(doFetchFileInfosAndPublishedClaims());
return Promise.resolve();
btzr-io commented 2017-10-18 08:11:39 +02:00 (Migrated from github.com)
Review

This fixed the issue with published page ^
See https://github.com/lbryio/lbry-app/pull/682#issuecomment-337434699

This fixed the issue with `published` page ^ See https://github.com/lbryio/lbry-app/pull/682#issuecomment-337434699
btzr-io commented 2017-10-19 20:32:22 +02:00 (Migrated from github.com)
Review

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();

View file

@ -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);

View file

@ -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")}