mirror of https://github.com/GooseMod/OpenAsar
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
834 B
45 lines
834 B
const { ipcMain, app, shell } = require('electron');
|
|
|
|
ipcMain.on('DISCORD_UPDATED_QUOTES', (e, c) => {
|
|
if (c === 'o') exports.open();
|
|
});
|
|
|
|
let win;
|
|
exports.open = () => {
|
|
if (win) return win.show();
|
|
|
|
win = require('../utils/win')({
|
|
width: 500,
|
|
height: 650
|
|
}, 'config');
|
|
|
|
win.on('close', () => {
|
|
win = null;
|
|
});
|
|
|
|
let config = settings.get('openasar', {});
|
|
config.setup = true;
|
|
settings.set('openasar', config);
|
|
settings.save();
|
|
|
|
ipcMain.on('cs', (e, c) => {
|
|
config = c;
|
|
settings.set('openasar', config);
|
|
settings.save();
|
|
});
|
|
|
|
ipcMain.on('cg', e => {
|
|
e.returnValue = config;
|
|
});
|
|
|
|
ipcMain.on('cr', () => {
|
|
settings.save();
|
|
app.relaunch();
|
|
app.exit();
|
|
});
|
|
|
|
ipcMain.on('of', () => {
|
|
shell.openPath(require('../paths').getUserData() + '/settings.json')
|
|
});
|
|
};
|