mirror of
https://github.com/docmost/docmost.git
synced 2025-11-16 08:51:10 +10:00
Show modal during upload
This commit is contained in:
@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user