From 702ddf1bc9bccf16778f28ea3aa21721307b4811 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Thu, 15 Sep 2022 10:01:48 -0700 Subject: [PATCH] Warn user for large selections --- src/components/Timeline.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/Timeline.vue b/src/components/Timeline.vue index cf8dba97..5f516238 100644 --- a/src/components/Timeline.vue +++ b/src/components/Timeline.vue @@ -865,6 +865,11 @@ export default class Timeline extends Mixins(GlobalMixin) { * Download the currently selected files */ 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)); } @@ -872,6 +877,12 @@ export default class Timeline extends Mixins(GlobalMixin) { * Delete the currently selected photos */ 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; const list = [...this.selection]; const delIds = await dav.deleteFilesByIds(list.map(p => p.fileid));