[MM-40277][MM-40279][MM-40301][MM-40307][MM-40310][MM-40313] Unit tests and refactors for main module (#1876)
* Refactor autoLauncher and remove unnecessary file * [MM-40277] Unit tests for main/badge * [MM-40279] Unit tests for main/certificateStore * [MM-40301] Unit tests for main/contextMenu, also remove workaround * [MM-40307] Unit tests for main/CriticalErrorHandler * [MM-40310] Unit tests for main/utils * [MM-40313] Unit tests for main/Validator * Lint fix * Added globals * More things that should probably already be merged * PR feedback
This commit is contained in:
@@ -55,7 +55,6 @@ import {protocols} from '../../electron-builder.json';
|
||||
|
||||
import AutoLauncher from './AutoLauncher';
|
||||
import CriticalErrorHandler from './CriticalErrorHandler';
|
||||
import upgradeAutoLaunch from './autoLaunch';
|
||||
import CertificateStore from './certificateStore';
|
||||
import TrustedOriginsStore from './trustedOrigins';
|
||||
import {createMenu as createAppMenu} from './menus/app';
|
||||
@@ -91,6 +90,7 @@ const {
|
||||
} = electron;
|
||||
const criticalErrorHandler = new CriticalErrorHandler();
|
||||
const userActivityMonitor = new UserActivityMonitor();
|
||||
const autoLauncher = new AutoLauncher();
|
||||
const certificateErrorCallbacks = new Map();
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
@@ -281,8 +281,7 @@ function handleConfigUpdate(newConfig: CombinedConfig) {
|
||||
return;
|
||||
}
|
||||
if (process.platform === 'win32' || process.platform === 'linux') {
|
||||
const appLauncher = new AutoLauncher();
|
||||
const autoStartTask = config.autostart ? appLauncher.enable() : appLauncher.disable();
|
||||
const autoStartTask = config.autostart ? autoLauncher.enable() : autoLauncher.disable();
|
||||
autoStartTask.then(() => {
|
||||
log.info('config.autostart has been configured:', newConfig.autostart);
|
||||
}).catch((err) => {
|
||||
@@ -684,7 +683,7 @@ function initializeAfterAppReady() {
|
||||
appVersion.lastAppVersion = app.getVersion();
|
||||
|
||||
if (!global.isDev) {
|
||||
upgradeAutoLaunch();
|
||||
autoLauncher.upgradeAutoLaunch();
|
||||
}
|
||||
|
||||
if (global.isDev) {
|
||||
|
Reference in New Issue
Block a user