From 5b334db3c997c5f06c808dc97ea1e963fc2fd72a Mon Sep 17 00:00:00 2001 From: Elio Date: Mon, 13 Jun 2022 10:17:56 +0200 Subject: [PATCH] #354 - Windows file parsing fix --- src/dashboardWebView/components/Media/Item.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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;