feat(app): Show add-on menu if start app with --addons arg (#359)
* refactor(store): Move app reducer from electron to shared module * feat(app): Show add-on menu if start app with --addons arg close: #351
This commit is contained in:
committed by
László Monda
parent
25257132a6
commit
a4d41f36d5
@@ -1,4 +1,5 @@
|
||||
/// <reference path="./custom_types/electron-is-dev.d.ts"/>
|
||||
/// <reference path="./custom_types/command-line-args.d.ts"/>
|
||||
|
||||
import { app, BrowserWindow, ipcMain } from 'electron';
|
||||
import { autoUpdater } from 'electron-updater';
|
||||
@@ -8,9 +9,17 @@ import { ProgressInfo } from 'electron-builder-http/out/ProgressCallbackTransfor
|
||||
import { VersionInfo } from 'electron-builder-http/out/publishOptions';
|
||||
import * as settings from 'electron-settings';
|
||||
import * as isDev from 'electron-is-dev';
|
||||
import * as commandLineArgs from 'command-line-args';
|
||||
|
||||
import { IpcEvents } from './shared/util';
|
||||
import { ElectronDataStorageRepositoryService } from './services/electron-datastorage-repository.service';
|
||||
import { CommandLineArgs } from './shared/models/command-line-args';
|
||||
|
||||
const optionDefinitions = [
|
||||
{ name: 'addons', type: Boolean, defaultOption: false }
|
||||
];
|
||||
|
||||
const options: CommandLineArgs = commandLineArgs(optionDefinitions);
|
||||
|
||||
// import './dev-extension';
|
||||
require('electron-debug')({ showDevTools: false, enabled: true });
|
||||
@@ -143,6 +152,8 @@ ipcMain.on(IpcEvents.app.appStarted, () => {
|
||||
|
||||
ipcMain.on(IpcEvents.autoUpdater.checkForUpdate, () => checkForUpdate());
|
||||
|
||||
ipcMain.on(IpcEvents.app.getCommandLineArgs, (event: any) => event.sender.send(IpcEvents.app.getCommandLineArgsReply, options));
|
||||
|
||||
function isFirstRun() {
|
||||
if (!settings.has('firstRunVersion')) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user