diff --git a/app/src/util/pathName.ts b/app/src/util/pathName.ts index debe280ea..2565d3740 100644 --- a/app/src/util/pathName.ts +++ b/app/src/util/pathName.ts @@ -80,7 +80,7 @@ export const getDisplayName = (filePath: string, basename = true, removeSY = fal }; export const getAssetName = (assetPath: string) => { - return assetPath.replace(/-\d{14}-\w{7}/, "").replace(pathPosix().extname(assetPath), "").replace("assets/", ""); + return pathPosix().basename(assetPath, pathPosix().extname(assetPath)).replace(/-\d{14}-\w{7}/, ""); }; export const isLocalPath = (link: string) => {