23 lines
752 B
TypeScript
23 lines
752 B
TypeScript
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";
|
|
|
|
ipcMain.on('basic-action', (event, action, ...args: any[]) => {
|
|
const window = BrowserWindow.fromWebContents(event.sender);
|
|
|
|
if(action === "open-changelog") {
|
|
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();
|
|
}
|
|
});
|