This commit is contained in:
Mikunj 2020-03-10 14:28:33 +11:00
parent d10a8f0a6f
commit 86b427cc4d
4 changed files with 19 additions and 9 deletions

14
app/base_config.d.ts vendored
View file

@ -1,11 +1,15 @@
export interface BaseConfig {
set(keyPath: string, value: any): void
get(keyPath: string): any | undefined
remove(): void
set(keyPath: string, value: any): void;
get(keyPath: string): any | undefined;
remove(): void;
}
interface Options {
allowMalformedOnStartup: boolean
allowMalformedOnStartup: boolean;
}
export function start(name: string, targetPath: string, options: Options): BaseConfig;
export function start(
name: string,
targetPath: string,
options: Options
): BaseConfig;

View file

@ -1,3 +1,3 @@
import { BaseConfig } from "./base_config";
import { BaseConfig } from './base_config';
type UserConfig = BaseConfig
type UserConfig = BaseConfig;

View file

@ -242,7 +242,8 @@ window.getMediaPermissions = () => ipc.sendSync('get-media-permissions');
// Auto update setting
window.getAutoUpdateEnabled = () => ipc.sendSync('get-auto-update-enabled');
window.setAutoUpdateEnabled = (value) => ipc.send('set-auto-update-enabled', !!value);
window.setAutoUpdateEnabled = value =>
ipc.send('set-auto-update-enabled', !!value);
ipc.on('get-ready-for-shutdown', async () => {
const { shutdown } = window.Events || {};

View file

@ -3,7 +3,6 @@ import * as fs from 'fs-extra';
import { autoUpdater, UpdateInfo } from 'electron-updater';
import { app, BrowserWindow } from 'electron';
import { markShouldQuit } from '../../app/window_state';
import { UserConfig } from '../../app/user_config';
import {
getPrintableError,
@ -29,6 +28,12 @@ export async function start(
messages: MessagesType,
logger: LoggerType
) {
if (interval) {
logger.info('auto-update: Already running');
return;
}
logger.info('auto-update: starting checks...');
autoUpdater.logger = logger;