Merge pull request #1857 from doniyor2109/master

Clear upgrade subscribed interval after declining
This commit is contained in:
Sean Yesmunt 2018-08-09 14:27:31 -04:00 committed by GitHub
commit f62181dbd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 2 deletions

View file

@ -48,7 +48,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

View file

@ -51,7 +51,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",
"mammoth": "^1.4.6",
"mime": "^2.3.1",

View file

@ -27,6 +27,7 @@ import {
selectUpgradeFilename,
selectAutoUpdateDeclined,
selectRemoteVersion,
selectUpgradeTimer,
} from 'redux/selectors/app';
import { lbrySettings as config } from 'package.json';
@ -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({
@ -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,
});

View file

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

View file

@ -84,3 +84,5 @@ export const selectCurrentLanguage = createSelector(
);
export const selectVolume = createSelector(selectState, state => state.volume);
export const selectUpgradeTimer = createSelector(selectState, state => state.checkUpgradeTimer);