From e7aaea53adf401fd819e7002e821011ff1e79e56 Mon Sep 17 00:00:00 2001 From: wisecolt Date: Sun, 1 Feb 2026 22:21:31 +0300 Subject: [PATCH] =?UTF-8?q?fix(files):=20dosya=20ta=C5=9F=C4=B1ma=20ve=20y?= =?UTF-8?q?ap=C4=B1=C5=9Ft=C4=B1rma=20i=C5=9Flemlerinde=20hedef=20yolunu?= =?UTF-8?q?=20d=C3=BCzelt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hedef yolu null veya undefined olduğunda işlemin erken sonlanmasını engeller. Hedef etiketi eksik olduğunda "Home" varsayılan değerini kullanır ve normalizePath işlemini boş string ile devam ettirir. --- client/src/routes/Files.svelte | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/client/src/routes/Files.svelte b/client/src/routes/Files.svelte index 7e8282d..a71a3d2 100644 --- a/client/src/routes/Files.svelte +++ b/client/src/routes/Files.svelte @@ -807,12 +807,12 @@ const sourcePath = resolveEntryOriginalPath(source); const targetPath = resolveEntryOriginalPath(target); - if (!sourcePath || !targetPath) return; + if (!sourcePath || targetPath === undefined || targetPath === null) return; const normalizedSource = normalizePath(sourcePath); - const normalizedTarget = normalizePath(targetPath); + const normalizedTarget = normalizePath(targetPath || ""); - if (!normalizedSource || !normalizedTarget) return; + if (!normalizedSource) return; if (source?.isDirectory) { if ( @@ -830,7 +830,8 @@ } const sourceLabel = cleanFileName(source.displayName || source.name || normalizedSource); - const targetLabel = cleanFileName(target.displayName || target.name || normalizedTarget); + const targetLabel = + cleanFileName(target.displayName || target.name || normalizedTarget) || "Home"; if (!confirm(`"${sourceLabel}" öğesini "${targetLabel}" içine taşımak istiyor musun?`)) { return; } @@ -1644,15 +1645,15 @@ const sourcePath = resolveEntryOriginalPath(clipboardItem); const targetPath = resolveOriginalPathForDisplay(currentPath, currentOriginalPath); - if (!sourcePath || !targetPath) { + if (!sourcePath || targetPath === undefined || targetPath === null) { alert("Geçersiz kaynak veya hedef yolu"); return; } const normalizedSource = normalizePath(sourcePath); - const normalizedTarget = normalizePath(targetPath); + const normalizedTarget = normalizePath(targetPath || ""); - if (!normalizedSource || !normalizedTarget) { + if (!normalizedSource) { alert("Geçersiz kaynak veya hedef yolu"); return; } @@ -1665,7 +1666,7 @@ } const sourceLabel = cleanFileName(clipboardItem.displayName || clipboardItem.name || normalizedSource); - const targetLabel = cleanFileName(currentPath || normalizedTarget); + const targetLabel = cleanFileName(currentPath || normalizedTarget) || "Home"; const actionLabel = clipboardOperation === 'cut' ? 'taşı' : 'kopyala'; if (!confirm(`"${sourceLabel}" öğesini "${targetLabel}" konumuna ${actionLabel}mak istiyor musun?`)) { return;