Remove ts/services/timers.ts

This commit is contained in:
Fedor Indutny
2021-10-06 14:59:34 -07:00
committed by GitHub
parent 26eabf16a8
commit a537204fc0
10 changed files with 38 additions and 144 deletions

View File

@@ -4,8 +4,8 @@
import { ThunkAction } from 'redux-thunk';
import * as updateIpc from '../../shims/updateIpc';
import { DialogType } from '../../types/Dialogs';
import { DAY } from '../../util/durations';
import { StateType as RootStateType } from '../reducer';
import { onTimeout } from '../../services/timers';
// State
@@ -85,8 +85,6 @@ function showUpdateDialog(
};
}
const ONE_DAY = 24 * 60 * 60 * 1000;
function snoozeUpdate(): ThunkAction<
void,
RootStateType,
@@ -95,12 +93,12 @@ function snoozeUpdate(): ThunkAction<
> {
return (dispatch, getState) => {
const { dialogType } = getState().updates;
onTimeout(Date.now() + ONE_DAY, () => {
setTimeout(() => {
dispatch({
type: UNSNOOZE_UPDATE,
payload: dialogType,
});
});
}, DAY);
dispatch({
type: SNOOZE_UPDATE,