Shun Miyazawa пре 4 месеци
родитељ
комит
6728f7ba4b
1 измењених фајлова са 5 додато и 2 уклоњено
  1. 5 2
      apps/app/src/client/components/Hotkeys/Subscribers/EditPage.jsx

+ 5 - 2
apps/app/src/client/components/Hotkeys/Subscribers/EditPage.jsx

@@ -1,13 +1,16 @@
 import { useEffect } from 'react';
 
+import { useTranslation } from 'next-i18next';
 import PropTypes from 'prop-types';
 
 import { useStartEditing } from '~/client/services/use-start-editing';
+import { toastError } from '~/client/util/toastr';
 import { useCurrentPathname } from '~/states/global';
 import { useIsEditable, useCurrentPagePath } from '~/states/page';
 import { useEditorMode } from '~/states/ui/editor';
 
 const EditPage = (props) => {
+  const { t } = useTranslation('commons');
   const isEditable = useIsEditable();
   const { setEditorMode } = useEditorMode();
   const startEditing = useStartEditing();
@@ -31,13 +34,13 @@ const EditPage = (props) => {
         await startEditing(path);
       }
       catch (err) {
-      //
+        toastError(t('toaster.create_failed', { target: path }));
       }
 
       // remove this
       props.onDeleteRender(this);
     })();
-  }, [startEditing, isEditable, path, props, setEditorMode]);
+  }, [startEditing, isEditable, path, props, setEditorMode, t]);
 
   return null;
 };