mirror of
https://github.com/samuelncui/yatm.git
synced 2026-01-07 13:55:21 +00:00
fix: cannot backup files under backup root
This commit is contained in:
@@ -160,18 +160,22 @@ const useBackupTargetBrowser = () => {
|
||||
const sources = files
|
||||
.map((file) => {
|
||||
if (!file) {
|
||||
return undefined;
|
||||
console.log('create backup job, cannot get file')
|
||||
return;
|
||||
}
|
||||
|
||||
let path = file.id.trim();
|
||||
if (path.length === 0) {
|
||||
console.log('create backup job, file id is too short', file)
|
||||
return;
|
||||
}
|
||||
while (path.endsWith("/")) {
|
||||
path = path.slice(0, -1);
|
||||
}
|
||||
const splitIdx = path.lastIndexOf("/");
|
||||
|
||||
let splitIdx = path.lastIndexOf("/");
|
||||
if (splitIdx < 0) {
|
||||
splitIdx = -1
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user