Warn user for large selections

pull/62/head
Varun Patil 2022-09-15 10:01:48 -07:00
parent 788662c676
commit 702ddf1bc9
1 changed files with 11 additions and 0 deletions

View File

@ -865,6 +865,11 @@ export default class Timeline extends Mixins(GlobalMixin) {
* Download the currently selected files * Download the currently selected files
*/ */
async downloadSelection() { async downloadSelection() {
if (this.selection.size >= 5) {
if (!confirm(this.t("memories", "You are about to download a large number of files. Are you sure?"))) {
return;
}
}
await dav.downloadFilesByIds([...this.selection].map(p => p.fileid)); await dav.downloadFilesByIds([...this.selection].map(p => p.fileid));
} }
@ -872,6 +877,12 @@ export default class Timeline extends Mixins(GlobalMixin) {
* Delete the currently selected photos * Delete the currently selected photos
*/ */
async deleteSelection() { async deleteSelection() {
if (this.selection.size >= 100) {
if (!confirm(this.t("memories", "You are about to delete a large number of files. Are you sure?"))) {
return;
}
}
this.loading = true; this.loading = true;
const list = [...this.selection]; const list = [...this.selection];
const delIds = await dav.deleteFilesByIds(list.map(p => p.fileid)); const delIds = await dav.deleteFilesByIds(list.map(p => p.fileid));