kaori 3 лет назад
Родитель
Сommit
e776d1b966

+ 3 - 5
packages/app/src/components/Navbar/GrowiContextualSubNavigation.tsx

@@ -205,12 +205,10 @@ const GrowiContextualSubNavigation = (props) => {
 
   }, [pageId, revisionId, mutateSWRTagsInfo, syncPageTagsForEditors]);
 
-  const tagsUpdatedHandlerForEditMode = useCallback(async(newTags: string[]) => {
+  const tagsUpdatedHandlerForEditMode = useCallback((newTags: string[]): void => {
     // It will not be reflected in the DB until the page is refreshed
-    syncPageTagsForEditors(newTags);
-    return;
-  // eslint-disable-next-line react-hooks/exhaustive-deps
-  }, [tagsInfoData?.tags]);
+    return syncPageTagsForEditors(newTags);
+  }, [syncPageTagsForEditors]);
 
   const duplicateItemClickedHandler = useCallback(async(page: IPageForPageDuplicateModal) => {
     const duplicatedHandler: OnDuplicatedFunction = (fromPath, toPath) => {

+ 1 - 1
packages/app/src/components/Navbar/GrowiSubNavigation.tsx

@@ -25,7 +25,7 @@ type Props = {
   isCompactMode?: boolean,
 
   tags?: string[],
-  tagsUpdatedHandler?: (newTags: string[]) => Promise<void>,
+  tagsUpdatedHandler?: (newTags: string[]) => Promise<void> | void,
 
   controls?: React.FunctionComponent,
   additionalClasses?: string[],