From 1da24f6adb7fce37af79678dd053090831fda2f2 Mon Sep 17 00:00:00 2001 From: Adam <2363879+adamdotdevin@users.noreply.github.com> Date: Tue, 28 Oct 2025 06:20:43 -0500 Subject: wip: desktop work --- packages/desktop/src/utils/path.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'packages/desktop/src/utils/path.ts') diff --git a/packages/desktop/src/utils/path.ts b/packages/desktop/src/utils/path.ts index 3ae48cdb3..d23568ae6 100644 --- a/packages/desktop/src/utils/path.ts +++ b/packages/desktop/src/utils/path.ts @@ -1,3 +1,5 @@ +import { useSync } from "@/context/sync" + export function getFilename(path: string) { if (!path) return "" const trimmed = path.replace(/[\/]+$/, "") @@ -6,8 +8,10 @@ export function getFilename(path: string) { } export function getDirectory(path: string) { + const sync = useSync() const parts = path.split("/") - return parts.slice(0, parts.length - 1).join("/") + const dir = parts.slice(0, parts.length - 1).join("/") + return dir ? sync.sanitize(dir + "/") : "" } export function getFileExtension(path: string) { -- cgit v1.2.3