fix
This commit is contained in:
parent
88965c8608
commit
14fb95c798
|
@ -152,7 +152,7 @@ function onDrop(ev: DragEvent) {
|
||||||
fileId: e.id,
|
fileId: e.id,
|
||||||
folderId: props.folder.id,
|
folderId: props.folder.id,
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
misskeyApi('drive/files/update', {
|
misskeyApi('drive/files/update', {
|
||||||
fileId: file.id,
|
fileId: file.id,
|
||||||
|
@ -236,7 +236,6 @@ function deleteFolder() {
|
||||||
misskeyApi('drive/folders/show', {
|
misskeyApi('drive/folders/show', {
|
||||||
folderId: props.folder.id,
|
folderId: props.folder.id,
|
||||||
}).then(async (r) => {
|
}).then(async (r) => {
|
||||||
|
|
||||||
if (r.foldersCount > 0) {
|
if (r.foldersCount > 0) {
|
||||||
await os.alert({
|
await os.alert({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
|
@ -246,7 +245,6 @@ function deleteFolder() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r.filesCount > 0) {
|
if (r.filesCount > 0) {
|
||||||
|
|
||||||
const { canceled } = await os.confirm({
|
const { canceled } = await os.confirm({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
text: i18n.t('driveFolderDeleteConfirm', { name: props.folder.name }),
|
text: i18n.t('driveFolderDeleteConfirm', { name: props.folder.name }),
|
||||||
|
@ -255,34 +253,32 @@ function deleteFolder() {
|
||||||
if (canceled) return;
|
if (canceled) return;
|
||||||
|
|
||||||
let allResults = [];
|
let allResults = [];
|
||||||
let Result = await os.api('drive/files', {folderId: props.folder.id, limit: 31});
|
let Result = await misskeyApi('drive/files', { folderId: props.folder.id, limit: 31 });
|
||||||
allResults = allResults.concat(Result)
|
allResults = allResults.concat(Result);
|
||||||
while (Result.length >= 31) {
|
while (Result.length >= 31) {
|
||||||
const untilId = Result[Result.length - 1].id;
|
const untilId = Result[Result.length - 1].id;
|
||||||
Result = await os.api('drive/files', { folderId: props.folder.id, limit: 31, untilId });
|
Result = await misskeyApi('drive/files', { folderId: props.folder.id, limit: 31, untilId });
|
||||||
allResults = allResults.concat(Result); // pushをconcatに変更
|
allResults = allResults.concat(Result); // pushをconcatに変更
|
||||||
}
|
}
|
||||||
allResults.forEach((r, i) => {
|
allResults.forEach((r, i) => {
|
||||||
os.api('drive/files/delete',{fileId: r.id})
|
misskeyApi('drive/files/delete', { fileId: r.id });
|
||||||
})
|
});
|
||||||
|
|
||||||
|
|
||||||
misskeyApi('drive/folders/show', {
|
misskeyApi('drive/folders/show', {
|
||||||
folderId: props.folder.id,
|
folderId: props.folder.id,
|
||||||
}).then(async (r) => {
|
}).then(async (r) => {
|
||||||
if (r.filesCount > 0) {
|
if (r.filesCount > 0) {
|
||||||
|
|
||||||
let allResults = [];
|
let allResults = [];
|
||||||
let Result = await os.api('drive/files', {folderId: props.folder.id, limit: 31});
|
let Result = await misskeyApi('drive/files', { folderId: props.folder.id, limit: 31 });
|
||||||
allResults = allResults.concat(Result)
|
allResults = allResults.concat(Result);
|
||||||
while (Result.length >= 31) {
|
while (Result.length >= 31) {
|
||||||
const untilId = Result[Result.length - 1].id;
|
const untilId = Result[Result.length - 1].id;
|
||||||
Result = await os.api('drive/files', { folderId: props.folder.id, limit: 31, untilId });
|
Result = await misskeyApi('drive/files', { folderId: props.folder.id, limit: 31, untilId });
|
||||||
allResults = allResults.concat(Result);
|
allResults = allResults.concat(Result);
|
||||||
}
|
}
|
||||||
allResults.forEach((r, i) => {
|
allResults.forEach((r, i) => {
|
||||||
os.api('drive/files/delete',{fileId: r.id})
|
misskeyApi('drive/files/delete', { fileId: r.id });
|
||||||
})
|
});
|
||||||
|
|
||||||
misskeyApi('drive/folders/delete', {
|
misskeyApi('drive/folders/delete', {
|
||||||
folderId: props.folder.id,
|
folderId: props.folder.id,
|
||||||
|
@ -309,16 +305,14 @@ function deleteFolder() {
|
||||||
|
|
||||||
misskeyApi('drive/folders/delete', {
|
misskeyApi('drive/folders/delete', {
|
||||||
folderId: props.folder.id,
|
folderId: props.folder.id,
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
misskeyApi('drive/folders/delete', {
|
misskeyApi('drive/folders/delete', {
|
||||||
folderId: props.folder.id,
|
folderId: props.folder.id,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
await misskeyApi('drive/folders/delete', {
|
await misskeyApi('drive/folders/delete', {
|
||||||
folderId: props.folder.id,
|
folderId: props.folder.id,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
@ -342,11 +336,9 @@ function deleteFolder() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function setAsUploadFolder() {
|
function setAsUploadFolder() {
|
||||||
defaultStore.set('uploadFolder', props.folder.id);
|
defaultStore.set('uploadFolder', props.folder.id);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue