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