updated window manager to open home

This commit is contained in:
andrei-mihnea-cerbu
2025-02-05 12:39:48 +02:00
parent 39b7150f0a
commit eda2e2d2a0
+4 -2
View File
@@ -1,4 +1,4 @@
import { BrowserWindow, dialog, shell } from 'electron'
import {app, BrowserWindow, dialog, shell} from 'electron'
import fs from 'fs'
import path from 'path'
@@ -61,6 +61,7 @@ export class WindowManager {
async selectDirectory(): Promise<string | undefined> {
const result = await dialog.showOpenDialog(this.mainWindow, {
properties: ['openDirectory'], // Only allow selecting directories
defaultPath: app.getPath('home')
})
if (result.filePaths && result.filePaths.length > 0) {
@@ -90,8 +91,9 @@ export class WindowManager {
async selectFile(): Promise<string | undefined> {
const result = await dialog.showOpenDialog(this.mainWindow, {
properties: ['openFile'], // Allow selecting a file
defaultPath: app.getPath('desktop'),
filters: [
{ name: 'All Files', extensions: ['*'] }, // Optionally filter for specific file types
{ name: 'All Files', extensions: ['*'] },
],
})