Shun Miyazawa 3 лет назад
Родитель
Сommit
176148c36a
1 измененных файлов с 1 добавлено и 2 удалено
  1. 1 2
      packages/app/src/components/PageEditor.tsx

+ 1 - 2
packages/app/src/components/PageEditor.tsx

@@ -123,7 +123,6 @@ const PageEditor = React.memo((): JSX.Element => {
     setMarkdownWithDebounce(value, isClean);
   }, [setMarkdownWithDebounce]);
 
-  // return true if the save succeeds, otherwise false.
   const save = useCallback(async(opts?: {overwriteScopesOfDescendants: boolean}): Promise<IPageHasId | null> => {
     if (grantData == null || isSlackEnabled == null || currentPathname == null) {
       logger.error('Some materials to save are invalid', { grantData, isSlackEnabled, currentPathname });
@@ -195,7 +194,7 @@ const PageEditor = React.memo((): JSX.Element => {
     }
 
     const page = await save();
-    if (page) {
+    if (page != null) {
       toastSuccess(t('toaster.save_succeeded'));
       await mutateCurrentPageId(page._id);
       await mutateCurrentPage();