From 068f36a5e47c3edabf9ff9cb37f655a50f399b7d Mon Sep 17 00:00:00 2001 From: Ben Hall Date: Sat, 15 Feb 2025 07:48:16 +0000 Subject: [PATCH] add warning if import takes over 60 seconds Signed-off-by: Ben Hall --- frontend/src/views/Import.svelte | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/Import.svelte b/frontend/src/views/Import.svelte index 4655f8a..8538c73 100644 --- a/frontend/src/views/Import.svelte +++ b/frontend/src/views/Import.svelte @@ -116,7 +116,7 @@ import Textarea from "../components/form/Textarea.svelte"; import { setDefaultHeaders } from "../includes/Auth.svelte"; - import { notifyError, notifySuccess } from "../js/util"; + import { notify, notifyError, notifySuccess } from "../js/util"; import axios from "axios"; import { API_URL } from "../js/constants"; setDefaultHeaders(); @@ -163,6 +163,14 @@ } queryLoading = true; + setTimeout(() => { + if (queryLoading) { + notify( + "Importing...", + "Your data is taking longer than expected to import, you can safely navigate away from this page and check back later.", + ); + } + }, 60 * 1000); const res = await axios.post( `${API_URL}/api/${guildId}/import`, frmData,