mime-chat/src/background.ts
Andrew Gundersen 72fd4aa6e0 cicd
2021-04-15 10:50:52 -05:00

47 lines
1.1 KiB
TypeScript

/*
* Entry point for Crimata electron app.
* "Look on my Works, ye Mighty, and despair!"
*/
"use strict";
const { autoUpdater } = require('electron-updater')
import { initApp } from './background/init';
import { protocol, dialog } from "electron";
// Scheme must be registered before the app is ready
protocol.registerSchemesAsPrivileged([
{ scheme: "app", privileges: { secure: true, standard: true } }
]);
// Load environment variable
const isDev = require('electron-is-dev');
// NOTE Program Begins Here
(async () => {
autoUpdater.requestHeaders = { 'PRIVATE-TOKEN': 'seMF_apn237iUw8puG9a' }
const dialogConfig = {
type: 'info',
buttons: ['Restart', 'Later'],
title: 'Application Update',
message: releaseName,
detail: 'A new version has been downloaded. Restart to update.'
}
autoUpdater.on('update-downloaded', () => {
autoUpdater.quitAndInstall()
})
autoUpdater.checkForUpdatesAndNotify()
setInterval(() => {
autoUpdater.checkForUpdatesAndNotify()
}, 120000)
console.log('Starting Crimata electron app.');
initApp(isDev);
})();