Show modal during upload

This commit is contained in:
Philipinho
2025-06-08 19:19:30 -07:00
parent d706959901
commit d8f6a32bb2

View File

@ -92,6 +92,14 @@ function ImportFormatSelection({ spaceId, onClose }: ImportFormatSelection) {
} }
try { try {
notifications.show({
id: "import",
message: t("Uploading import file"),
loading: true,
withCloseButton: false,
autoClose: false,
});
const importTask = await importZip(selectedFile, spaceId, source); const importTask = await importZip(selectedFile, spaceId, source);
notifications.show({ notifications.show({
id: "import", id: "import",
@ -105,12 +113,12 @@ function ImportFormatSelection({ spaceId, onClose }: ImportFormatSelection) {
setFileTaskId(importTask.id); setFileTaskId(importTask.id);
onClose(); onClose();
} catch (err) { } catch (err) {
console.log("Failed to import page", err); console.log("Failed to upload import file", err);
notifications.update({ notifications.update({
id: "import", id: "import",
color: "red", color: "red",
title: t("Failed to import pages"), title: t("Failed to upload import file"),
message: t("Unable to import pages. Please try again."), message: err?.response.data.message,
icon: <IconX size={18} />, icon: <IconX size={18} />,
loading: false, loading: false,
withCloseButton: true, withCloseButton: true,