fix: I can't send a file on its own. (#1304)

https://github.com/Termix-SSH/Support/issues/1304
This commit is contained in:
LukeGus committed 2026-09-20 19:06:54 -05:00
1 parent e9fd092ebd
commit 7727fa09fb
2 files changed
+23 -2

No files matched your search

+8 -1
View File
@@ -1921,13 +1921,20 @@ function FileManagerContent({
if (!sourceSessionId) return;
const sourcePaths = files.map((f) => f.path);
const isSingleFile = files.length === 1 && files[0].type === "file";
const base = currentPath.replace(/\/+$/, "") || "/";
const destPath = isSingleFile
? base.endsWith("/")
? `${base}${files[0].name}`
: `${base}/${files[0].name}`
: base;
try {
const { transferId } = await transferToHost(
sourceSessionId,
sourcePaths,
sshSessionId,
currentPath,
destPath,
operation === "cut",
"auto",
2,
+15 -1
View File
@@ -717,13 +717,27 @@ export function SftpTransferTab() {
return;
}
let destTarget = destDir;
if (paths.length === 1) {
const sourceEntries =
sourcePane.sessionId === sourceSessionId
? sourcePane.entries
: destPane.sessionId === sourceSessionId
? destPane.entries
: [];
const entry = sourceEntries.find((e) => e.path === paths[0]);
if (entry && entry.type === "file") {
destTarget = joinRemotePath(destDir, entry.name);
}
}
setTransferring(true);
try {
const { transferId } = await transferToHost(
sourceSessionId,
paths,
destinationSessionId,
destDir,
destTarget,
moveFiles,
"auto",
);