Skip to content

Commit f2193bb

Browse files
committed
🐛 暂时解决窗口打不开的问题
1 parent 08bfb9f commit f2193bb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/src/core/service/GlobalMenu.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { appCacheDir, dataDir, join } from "@tauri-apps/api/path";
2121
import { getCurrentWindow } from "@tauri-apps/api/window";
2222
import { open, save } from "@tauri-apps/plugin-dialog";
2323
import { readTextFile, writeTextFile } from "@tauri-apps/plugin-fs";
24-
import { open as openFilePath, open as shellOpen } from "@tauri-apps/plugin-shell";
24+
import { open as shellOpen } from "@tauri-apps/plugin-shell";
2525
import { useAtom } from "jotai";
2626
import {
2727
Airplay,
@@ -285,7 +285,8 @@ export function GlobalMenu() {
285285
<Item
286286
onClick={async () => {
287287
const path = await join(await dataDir(), "liren.project-graph");
288-
openFilePath(path);
288+
console.log(path);
289+
await open({ directory: true, defaultPath: path });
289290
}}
290291
>
291292
<FolderCog />
@@ -294,7 +295,7 @@ export function GlobalMenu() {
294295
<Item
295296
onClick={async () => {
296297
const path = await appCacheDir();
297-
openFilePath(path);
298+
await open({ directory: true, defaultPath: path });
298299
}}
299300
>
300301
<FolderClock />
@@ -304,7 +305,7 @@ export function GlobalMenu() {
304305
disabled={!activeProject || activeProject.isDraft}
305306
onClick={async () => {
306307
const absPath = activeProject!.uri.fsPath;
307-
openFilePath(absPath);
308+
await open({ directory: true, defaultPath: absPath });
308309
}}
309310
>
310311
<FolderOpen />

0 commit comments

Comments
 (0)