hyper/lib/actions/updater.ts

23 lines
519 B
TypeScript
Raw Normal View History

import {UPDATE_INSTALL, UPDATE_AVAILABLE} from '../constants/updater';
2016-07-13 12:44:24 -08:00
import rpc from '../rpc';
2023-06-26 01:29:50 -08:00
import type {HyperActions} from '../hyper';
2016-07-13 12:44:24 -08:00
2020-01-02 09:27:27 -09:00
export function installUpdate(): HyperActions {
2016-07-13 12:44:24 -08:00
return {
type: UPDATE_INSTALL,
effect: () => {
2023-06-25 05:26:16 -08:00
rpc.emit('quit and install');
2016-07-13 12:44:24 -08:00
}
};
}
2020-01-02 09:27:27 -09:00
export function updateAvailable(version: string, notes: string, releaseUrl: string, canInstall: boolean): HyperActions {
2016-07-13 12:44:24 -08:00
return {
type: UPDATE_AVAILABLE,
version,
notes,
releaseUrl,
canInstall
2016-07-13 12:44:24 -08:00
};
}