Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear upgrade subscribed interval after declining #1857

Merged
merged 5 commits into from
Aug 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).

### Fixed
* Edit option missing from certain published claims ([#1756](https://github.com/lbryio/lbry-desktop/issues/1756))
* Fix navigation issue with channels that have more than one page ([#1797](https://github.com/lbryio/lbry-desktop/pull/1797))
* Navigation issue with channels that have more than one page ([#1797](https://github.com/lbryio/lbry-desktop/pull/1797))
* Navigation issue with channels that have more than one page ([#1797](https://github.com/lbryio/lbry-desktop/pull/1797))
* Upgrade modals would stack on-top of each other if the app was kept open for a long time ([#1857](https://github.com/lbryio/lbry-desktop/pull/1857))


## [0.22.2] - 2018-07-09
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"formik": "^0.10.4",
"hast-util-sanitize": "^1.1.2",
"keytar": "^4.2.1",
"lbry-redux": "lbryio/lbry-redux#b4fffe863df316bc73183567ab978221ee623b8c",
"lbry-redux": "lbryio/lbry-redux#83fec2a8419cbf0f1fafdc98a50dab3051191ef5",
"localforage": "^1.7.1",
"mime": "^2.3.1",
"mixpanel-browser": "^2.17.1",
Expand Down
18 changes: 18 additions & 0 deletions src/renderer/redux/actions/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
selectUpgradeFilename,
selectAutoUpdateDeclined,
selectRemoteVersion,
selectUpgradeTimer,
} from 'redux/selectors/app';
import { lbrySettings as config } from 'package.json';

Expand Down Expand Up @@ -138,6 +139,19 @@ export function doDownloadUpgradeRequested() {
};
}

export function doClearUpgradeTimer() {
return (dispatch, getState) => {
const state = getState();

if (selectUpgradeTimer(state)) {
clearInterval(selectUpgradeTimer(state));
dispatch({
type: ACTIONS.CLEAR_UPGRADE_TIMER,
});
}
};
}

export function doAutoUpdate() {
return dispatch => {
dispatch({
Expand All @@ -149,11 +163,15 @@ export function doAutoUpdate() {
id: MODALS.AUTO_UPDATE_DOWNLOADED,
})
);

dispatch(doClearUpgradeTimer());
};
}

export function doAutoUpdateDeclined() {
return dispatch => {
dispatch(doClearUpgradeTimer());

dispatch({
type: ACTIONS.AUTO_UPDATE_DECLINED,
});
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/redux/reducers/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ reducers[ACTIONS.HISTORY_NAVIGATE] = state =>
modalProps: {},
});

reducers[ACTIONS.CLEAR_UPGRADE_TIMER] = state =>
Object.assign({}, state, {
checkUpgradeTimer: undefined,
});

export default function reducer(state: AppState = defaultState, action: any) {
const handler = reducers[action.type];
if (handler) return handler(state, action);
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/redux/selectors/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@ export const selectCurrentLanguage = createSelector(
);

export const selectVolume = createSelector(selectState, state => state.volume);

export const selectUpgradeTimer = createSelector(selectState, state => state.checkUpgradeTimer);