diff --git a/src/components/CreateSightArticle.tsx b/src/components/CreateSightArticle.tsx index cda29fa..1af0293 100644 --- a/src/components/CreateSightArticle.tsx +++ b/src/components/CreateSightArticle.tsx @@ -234,10 +234,12 @@ export const CreateSightArticle = ({ } if (onSave) { onSave(response.data); - notification.open({ - message: "Статья успешно создана", - type: "success", - }); + if (notification && typeof notification.open === "function") { + notification.open({ + message: "Статья успешно создана", + type: "success", + }); + } } else { window.location.reload(); } diff --git a/src/pages/snapshot/list.tsx b/src/pages/snapshot/list.tsx index a0cb5f1..41a232c 100644 --- a/src/pages/snapshot/list.tsx +++ b/src/pages/snapshot/list.tsx @@ -65,15 +65,19 @@ export const SnapshotList = observer(() => { } ); - notification?.open({ - message: "Cнапшот восстановлен", - type: "success", - }); + if (notification && typeof notification.open === "function") { + notification.open({ + message: "Cнапшот восстановлен", + type: "success", + }); + } } catch (error) { - notification?.open({ - message: "Ошибка при восстановлении снимка", - type: "error", - }); + if (notification && typeof notification.open === "function") { + notification.open({ + message: "Ошибка при восстановлении снимка", + type: "error", + }); + } } };