Skip to content

Commit 8dd194a

Browse files
committed
🔥 暂时关闭CLI在windows中的使用通道,直接用软件方式打开json文件容易出错
1 parent c492bf7 commit 8dd194a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

app/src/main.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ import "./index.css";
3232
import "./polyfills/roundRect";
3333
import { exists } from "./utils/fs";
3434
import { exit, writeStderr } from "./utils/otherApi";
35-
import { getCurrentWindow, isDesktop, isFrame, isWeb } from "./utils/platform";
35+
import { getCurrentWindow, isDesktop, isFrame, isWeb, isWindows } from "./utils/platform";
3636
import { ShortcutKeysRegister } from "./core/service/controlService/shortcutKeysEngine/shortcutKeysRegister";
3737
import { FileLoader } from "./core/service/dataFileService/fileLoader";
38+
import { Dialog } from "./components/dialog";
3839

3940
const router = createMemoryRouter(routes);
4041
const Routes = () => <RouterProvider router={router} />;
@@ -121,7 +122,19 @@ async function loadStartFile() {
121122
if (isDesktop && !isWeb) {
122123
const cliMatches = await getMatches();
123124
if (cliMatches.args.path.value) {
125+
// ?
124126
path = cliMatches.args.path.value as string;
127+
if (isWindows) {
128+
path = "【不要把json文件的打开方式设置成此软件,应在软件内打开】";
129+
setTimeout(() => {
130+
Dialog.show({
131+
title: "提示",
132+
content: "不要把json文件的打开方式设置成此软件,应在软件内打开,具体原因详见:",
133+
code: "https://project-graph.top/docs/app/announcement",
134+
type: "warning",
135+
});
136+
}, 3000);
137+
}
125138
} else {
126139
path = await StartFilesManager.getCurrentStartFile();
127140
}

0 commit comments

Comments
 (0)