From 36fa7c45d735765b773a4b928ea2a77d071f90b8 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 | 25 ++++++++++++++++++ package-lock.json | 32 +++++++++++++++++++++++ package.json | 1 + 5 files changed, 78 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 -->