mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
migrate from remote to ipc
This commit is contained in:
@ -1,6 +1,19 @@
|
||||
const app = require("electron").app || require('@electron/remote').app;
|
||||
const is = require("electron-is");
|
||||
|
||||
const { app, BrowserWindow, ipcMain, ipcRenderer } = require("electron");
|
||||
const config = require("../config");
|
||||
|
||||
module.exports.restart = () => {
|
||||
app.relaunch();
|
||||
app.exit();
|
||||
is.main() ? restart() : ipcRenderer.send('restart');
|
||||
};
|
||||
|
||||
module.exports.setupAppControls = () => {
|
||||
ipcMain.on('restart', restart);
|
||||
ipcMain.handle('getDownloadsFolder', () => app.getPath("downloads"));
|
||||
ipcMain.on('reload', () => BrowserWindow.getFocusedWindow().webContents.loadURL(config.get("url")));
|
||||
}
|
||||
|
||||
function restart() {
|
||||
app.relaunch();
|
||||
app.exit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user