Clear upgrade subscribed interval after declining

This commit is contained in:
Aliyev Doniyor 2018-08-06 22:25:30 +05:00
parent 42a3759cc0
commit 7119a43742
2 changed files with 10 additions and 1 deletions

View file

@ -27,6 +27,7 @@ import {
selectUpgradeFilename, selectUpgradeFilename,
selectAutoUpdateDeclined, selectAutoUpdateDeclined,
selectRemoteVersion, selectRemoteVersion,
selectUpgradeTimer,
} from 'redux/selectors/app'; } from 'redux/selectors/app';
import { lbrySettings as config } from 'package.json'; import { lbrySettings as config } from 'package.json';
@ -153,7 +154,13 @@ export function doAutoUpdate() {
} }
export function doAutoUpdateDeclined() { export function doAutoUpdateDeclined() {
return dispatch => { return (dispatch, getState) => {
const state = getState();
if (selectUpgradeTimer(state)) {
clearInterval(selectUpgradeTimer(state));
}
dispatch({ dispatch({
type: ACTIONS.AUTO_UPDATE_DECLINED, type: ACTIONS.AUTO_UPDATE_DECLINED,
}); });

View file

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