diff --git a/src/dashboardWebView/components/Media/Item.tsx b/src/dashboardWebView/components/Media/Item.tsx index 373b4cf3..66d4eeb1 100644 --- a/src/dashboardWebView/components/Media/Item.tsx +++ b/src/dashboardWebView/components/Media/Item.tsx @@ -61,10 +61,14 @@ export const Item: React.FunctionComponent = ({media}: React.PropsWi const getRelPath = () => { let relPath: string | undefined = ""; if (settings?.wsFolder && media.fsPath) { - relPath = media.fsPath.split(settings.wsFolder).pop(); + const wsFolderParsed = parseWinPath(settings.wsFolder); + const mediaParsed = parseWinPath(media.fsPath); + + relPath = mediaParsed.split(wsFolderParsed).pop(); if (settings.staticFolder && relPath) { - relPath = relPath.split(settings.staticFolder).pop(); + const staticFolderParsed = parseWinPath(settings.staticFolder); + relPath = relPath.split(staticFolderParsed).pop(); } } return relPath;