2019-10-25 19:51:40 -04:00
|
|
|
import "./menu";
|
|
|
|
|
|
|
|
import * as electron from "electron";
|
|
|
|
import ipcMain = electron.ipcMain;
|
|
|
|
import BrowserWindow = electron.BrowserWindow;
|
|
|
|
|
|
|
|
import {open as open_changelog} from "../app-updater/changelog";
|
|
|
|
import * as updater from "../app-updater";
|
2019-11-24 12:38:50 -05:00
|
|
|
import {execute_connect_urls} from "../instance_handler";
|
|
|
|
import {process_args} from "../../shared/process-arguments";
|
2019-10-25 19:51:40 -04:00
|
|
|
|
|
|
|
ipcMain.on('basic-action', (event, action, ...args: any[]) => {
|
|
|
|
const window = BrowserWindow.fromWebContents(event.sender);
|
|
|
|
|
2019-11-24 12:38:50 -05:00
|
|
|
if(action == "parse-connect-arguments") {
|
|
|
|
execute_connect_urls(process_args["_"] || []);
|
|
|
|
} else if(action === "open-changelog") {
|
2019-10-25 19:51:40 -04:00
|
|
|
open_changelog();
|
|
|
|
} else if(action === "check-native-update") {
|
|
|
|
updater.selected_channel().then(channel => updater.execute_graphical(channel, true));
|
|
|
|
} else if(action === "open-dev-tools") {
|
|
|
|
window.webContents.openDevTools();
|
|
|
|
} else if(action === "reload-window") {
|
|
|
|
window.reload();
|
|
|
|
}
|
|
|
|
});
|