From c61448573bab680116d34f4bfdbe7fb9432c306b Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 29 Oct 2024 15:40:07 +0100 Subject: [PATCH] feat: Rate-limit image previews Image preloading should be rate limited, to not overload the server. Now it is set to max. 5 requests at the same time. Signed-off-by: Ferdinand Thiessen --- lib/components/FilePicker/FilePreview.vue | 26 +++++++----------- lib/composables/preview.ts | 12 ++++++++- lib/utils/imagePreload.ts | 24 +++++++++++++++++ package-lock.json | 32 +++++++++++++++++++++++ package.json | 1 + 5 files changed, 77 insertions(+), 18 deletions(-) create mode 100644 lib/utils/imagePreload.ts diff --git a/lib/components/FilePicker/FilePreview.vue b/lib/components/FilePicker/FilePreview.vue index e3efc398..0445f086 100644 --- a/lib/components/FilePicker/FilePreview.vue +++ b/lib/components/FilePicker/FilePreview.vue @@ -3,9 +3,9 @@ - SPDX-License-Identifier: AGPL-3.0-or-later -->