Improve reliability of document operations with websocket disconnected

This commit is contained in:
Tom Moor
2023-10-22 23:21:33 -04:00
parent 1abe4964e8
commit 5fc68db5da
3 changed files with 24 additions and 80 deletions

View File

@@ -246,13 +246,17 @@ export const unpublishDocument = createAction({
return;
}
await document.unpublish();
try {
await document.unpublish();
toast.message(
t("Unpublished {{ documentName }}", {
documentName: document.noun,
})
);
toast.success(
t("Unpublished {{ documentName }}", {
documentName: document.noun,
})
);
} catch (err) {
toast.error(err.message);
}
},
});