Logic for opening settings.json (#77)

Co-authored-by: Julian pettersen <darlion2301@gmail.com>
This commit is contained in:
Julian Pettersen 2022-08-07 14:37:32 +02:00 committed by GitHub
parent ed2d0045ff
commit 4606f93e52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -30,4 +30,11 @@ exports.open = () => {
app.relaunch();
app.exit();
});
ipcMain.on('of', () => {
const { shell } = require('electron')
const { getUserData } = require('../paths')
const {join} = require('path')
shell.openPath(join(getUserData(), 'settings.json'))
})
};

View file

@ -4,5 +4,6 @@ const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('Native', {
restart: () => ipcRenderer.send('cr'),
set: c => ipcRenderer.send('cs', c),
get: () => ipcRenderer.sendSync('cg')
get: () => ipcRenderer.sendSync('cg'),
openFile: () => ipcRenderer.send('of')
});