Skip to content

Commit 87a3b62

Browse files
committed
fix
1 parent eb0f4d7 commit 87a3b62

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib/openFolder.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ const convertToProotPath = (url = "") => {
5252
if (isAcodeTerminalPublicSafUri(url)) {
5353
try {
5454
const { docId } = Uri.parse(url);
55-
const cleanDocId = decodeURIComponent(docId || "");
55+
const cleanDocId = /::/.test(url)
56+
? decodeURIComponent(docId || "")
57+
: docId || "";
5658
if (!cleanDocId) return "/public";
5759
if (cleanDocId.startsWith(publicDir)) {
5860
return cleanDocId.replace(publicDir, "/public") || "/public";
@@ -64,7 +66,9 @@ const convertToProotPath = (url = "") => {
6466
const relativePath = cleanDocId.slice("public:".length);
6567
return relativePath ? Path.join("/public", relativePath) : "/public";
6668
}
67-
const relativePath = cleanDocId.replace(/^\/+/, "");
69+
const relativePath = cleanDocId
70+
.replace(/^\/+/, "")
71+
.replace(/^public\//, "");
6872
return relativePath ? Path.join("/public", relativePath) : "/public";
6973
} catch (error) {
7074
console.warn(

0 commit comments

Comments
 (0)