fix: decode URL
This commit is contained in:
parent
dc04042b53
commit
63fa500716
|
|
@ -46,7 +46,7 @@ export function ArtifactFileDetail({
|
|||
const filepath = useMemo(() => {
|
||||
if (isWriteFile) {
|
||||
const url = new URL(filepathFromProps);
|
||||
return url.pathname;
|
||||
return decodeURIComponent(url.pathname);
|
||||
}
|
||||
return filepathFromProps;
|
||||
}, [filepathFromProps, isWriteFile]);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ export function FileViewer({
|
|||
const { isCodeFile, language } = useMemo(() => {
|
||||
if (isWriteFile) {
|
||||
const url = new URL(filepath);
|
||||
const path = url.pathname;
|
||||
const path = decodeURIComponent(url.pathname);
|
||||
return checkCodeFile(path);
|
||||
}
|
||||
return checkCodeFile(filepath);
|
||||
|
|
|
|||
Loading…
Reference in New Issue