mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-08 05:31:39 +00:00
parent
6b91ee4a25
commit
7562c619d2
3 changed files with 35 additions and 10 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import type { TitleTheme } from '/@/shared/types/types';
|
||||
|
||||
import { ipcMain, nativeTheme, safeStorage } from 'electron';
|
||||
import { dialog, ipcMain, nativeTheme, OpenDialogOptions, safeStorage } from 'electron';
|
||||
import Store from 'electron-store';
|
||||
|
||||
export const store = new Store();
|
||||
|
|
@ -55,3 +55,12 @@ ipcMain.on('theme-set', (_event, theme: TitleTheme) => {
|
|||
store.set('theme', theme);
|
||||
nativeTheme.themeSource = theme;
|
||||
});
|
||||
|
||||
ipcMain.handle('open-file-selector', async (_event, options: OpenDialogOptions) => {
|
||||
const result = await dialog.showOpenDialog({
|
||||
...options,
|
||||
properties: ['openFile'],
|
||||
});
|
||||
|
||||
return result.filePaths[0] || null;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue