2023-07-25 02:39:11 -08:00
|
|
|
import {UPDATE_INSTALL, UPDATE_AVAILABLE} from '../../typings/constants/updater';
|
2023-07-25 01:39:51 -08:00
|
|
|
import type {HyperActions} from '../../typings/hyper';
|
2023-07-25 09:30:19 -08:00
|
|
|
import rpc from '../rpc';
|
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,
|
2017-11-29 04:26:24 -09:00
|
|
|
notes,
|
|
|
|
|
releaseUrl,
|
|
|
|
|
canInstall
|
2016-07-13 12:44:24 -08:00
|
|
|
};
|
|
|
|
|
}
|