diff --git a/packages/desktop/src/main/files/index.ts b/packages/desktop/src/main/files/index.ts index fcf2704ce67..108e71a530f 100644 --- a/packages/desktop/src/main/files/index.ts +++ b/packages/desktop/src/main/files/index.ts @@ -72,6 +72,7 @@ function make( return { openDirectoryPicker: Effect.fn("DesktopFiles.openDirectoryPicker")(function* (options?: DirectoryPickerOptions) { const defaultPath = yield* start(options?.defaultPath) + const result = yield* Effect.promise(() => dialog.showOpenDialog({ properties: ["openDirectory", ...(options?.multiple ? ["multiSelections" as const] : []), "createDirectory"], @@ -91,6 +92,7 @@ function make( return yield* Effect.gen(function* () { const defaultPath = yield* start(options?.defaultPath) + const result = yield* Effect.promise(() => dialog.showOpenDialog({ properties: ["openFile", ...(options?.multiple ? ["multiSelections" as const] : [])], @@ -122,6 +124,7 @@ function make( releasePickedFiles: pickedFiles.release, saveFile: Effect.fn("DesktopFiles.saveFile")(function* (options: SaveFilePickerOptions, content: string) { const defaultPath = yield* start(options?.defaultPath, true) + const result = yield* Effect.promise(() => dialog.showSaveDialog({ title: options?.title ?? nativeT("desktop.dialog.saveFile"), diff --git a/packages/desktop/src/main/files/picker-start.test.ts b/packages/desktop/src/main/files/picker-start.test.ts index 00bdece3178..2872f073e7e 100644 --- a/packages/desktop/src/main/files/picker-start.test.ts +++ b/packages/desktop/src/main/files/picker-start.test.ts @@ -3,6 +3,7 @@ import path from "node:path" import { pickerStarts } from "./picker-start" const home = path.resolve("home", "me") + const project = path.resolve("work", "project") test.each([