change pipe name

This commit is contained in:
HorizonCode 2022-10-16 16:47:31 +02:00
parent 283e125e38
commit 071b13ee6e

8
app.js
View File

@ -1,6 +1,7 @@
const { app, BrowserWindow, ipcMain, dialog } = require('electron'); const { app, BrowserWindow, ipcMain, dialog } = require('electron');
const { setupTitlebar, attachTitlebarToWindow } = require('custom-electron-titlebar/main'); const { setupTitlebar, attachTitlebarToWindow } = require('custom-electron-titlebar/main');
const windowManager = require('./ui/windowManager'); const windowManager = require('./ui/windowManager');
const osuUtil = require('./osuUtil');
const run = () => { const run = () => {
const gotTheLock = app.requestSingleInstanceLock() const gotTheLock = app.requestSingleInstanceLock()
@ -20,11 +21,14 @@ const run = () => {
app.on('window-all-closed', () => { app.on('window-all-closed', () => {
app.quit() app.quit()
}) })
ipcMain.handle('open-folder-dialog', async (event) => { ipcMain.handle('set-osu-dir', async (event) => {
const yes = await dialog.showOpenDialog({ const yes = await dialog.showOpenDialog({
properties: ['openDirectory'] properties: ['openDirectory']
}) })
return yes.filePaths; if (yes.filePaths.length <= 0)
return undefined;
const folderPath = yes.filePaths[0];
return osuUtil.isValidOsuFolder(folderPath);
}) })
}) })
} }