fix file path replacement to handle both add/replace (#1749)

This commit is contained in:
jeffvli
2026-03-09 00:55:13 -07:00
parent 58ae76ce2a
commit 078d8068e0
+4 -3
View File
@@ -565,9 +565,10 @@ export const sortRadioList = (
}; };
export const replacePathPrefix = (path: string, replacePrefix?: string, addPrefix?: string) => { export const replacePathPrefix = (path: string, replacePrefix?: string, addPrefix?: string) => {
if (replacePrefix && path.startsWith(replacePrefix)) { let newPath = path;
return path.slice(replacePrefix.length); if (replacePrefix && newPath.startsWith(replacePrefix)) {
newPath = newPath.slice(replacePrefix.length);
} }
return addPrefix ? addPrefix + path : path; return addPrefix ? addPrefix + newPath : newPath;
}; };