From 809f8c14614111bdf01e0ef2e13ca81c92829fe8 Mon Sep 17 00:00:00 2001 From: codetypes Date: Wed, 17 Apr 2024 11:15:24 +0800 Subject: [PATCH] fix subtree path on windows --- src/components/inspector.tsx | 2 +- src/components/titlebar.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/inspector.tsx b/src/components/inspector.tsx index 1957f2c..28b64a8 100644 --- a/src/components/inspector.tsx +++ b/src/components/inspector.tsx @@ -89,7 +89,7 @@ export const Inspector: FC = () => { const subtreeOptions = useMemo(() => { const options: OptionType[] = []; workspace.allFiles.forEach((path) => { - const value = Path.relative(workspace.fileTree!.path, path); + const value = Path.relative(workspace.fileTree!.path, path).replaceAll(Path.sep, "/"); const desc = ""; //fileNode.desc ? `(${fileNode.desc})` : ""; options.push({ label: `${value}${desc}`, diff --git a/src/components/titlebar.tsx b/src/components/titlebar.tsx index 4b1ea0e..0a65b20 100644 --- a/src/components/titlebar.tsx +++ b/src/components/titlebar.tsx @@ -24,7 +24,7 @@ export const TitleBar: FC = () => { const searchOptions = useMemo(() => { const options: OptionType[] = []; workspace.allFiles.forEach((path) => { - const value = Path.relative(workspace.fileTree!.path, path); + const value = Path.relative(workspace.fileTree!.path, path).replaceAll(Path.sep, "/"); options.push({ label: (