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

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

@@ -176,7 +176,7 @@ const GrowiContextualSubNavigation = (props) => {
   const [isPageTemplateModalShown, setIsPageTempleteModalShown] = useState(false);
 
   const {
-    /* editorContainer, */ isCompactMode, isLinkSharingDisabled,
+    isCompactMode, isLinkSharingDisabled,
   } = props;
 
   const isViewMode = editorMode === EditorMode.View;
@@ -184,12 +184,11 @@ const GrowiContextualSubNavigation = (props) => {
   const tagsUpdatedHandler = useCallback(async(newTags: string[]) => {
     // It will not be reflected in the DB until the page is refreshed
     if (editorMode === EditorMode.Editor) {
-      console.log('newTags', newTags);
-      return mutateEditorContainerTags(newTags);
+      return mutateEditorContainerTags(newTags, false);
     }
 
     try {
-      const { tags } = await apiPost('/tags.update', { pageId, revisionId, tags: newTags }) as { tags };
+      await apiPost('/tags.update', { pageId, revisionId, tags: newTags }) as { tags };
 
       // revalidate SWRTagsInfo
       mutateSWRTagsInfo();
@@ -315,8 +314,6 @@ const GrowiContextualSubNavigation = (props) => {
     updatedAt: updatedAt ?? undefined,
   };
 
-  console.log('tagsOnEditorMode', tagsOnEditorMode);
-
   return (
     <GrowiSubNavigation
       page={currentPage}

+ 0 - 3
packages/app/src/components/Page.jsx

@@ -12,7 +12,6 @@ import {
   useCurrentPagePath, useIsGuestUser, useCurrentPageId,
 } from '~/stores/context';
 import { useSWRxSlackChannels, useIsSlackEnabled, useStaticPageTags } from '~/stores/editor';
-// import { useSWRxTagsInfo } from '~/stores/page';
 import {
   useEditorMode, useIsMobile, useSelectedGrant, useSelectedGrantGroupId, useSelectedGrantGroupName,
 } from '~/stores/ui';
@@ -192,13 +191,11 @@ const PageWrapper = (props) => {
   const { data: slackChannelsData } = useSWRxSlackChannels(currentPagePath);
   const { data: isSlackEnabled } = useIsSlackEnabled();
   const { data: pageId } = useCurrentPageId();
-  console.log({ pageId });
   const { data: tagsInfoData } = useStaticPageTags(pageId);
   const { data: grant } = useSelectedGrant();
   const { data: grantGroupId } = useSelectedGrantGroupId();
   const { data: grantGroupName } = useSelectedGrantGroupName();
 
-  // console.log('tagsInfoData', tagsInfoData);
   const pageRef = useRef(null);
 
   // set handler to open DrawioModal

+ 0 - 3
packages/app/src/stores/editor.tsx

@@ -7,8 +7,6 @@ import { Nullable } from '~/interfaces/common';
 import { IEditorSettings } from '~/interfaces/editor-settings';
 import { ITagNames } from '~/interfaces/tag';
 import { SlackChannels } from '~/interfaces/user-trigger-notification';
-// import { useSWRxTagsInfo } from '~/stores/page';
-import { useSWRxPageTags } from '~/stores/tag';
 
 import {
   useCurrentUser, useDefaultIndentSize, useIsGuestUser,
@@ -95,6 +93,5 @@ export const useIsSlackEnabled = (): SWRResponse<boolean, Error> => {
 };
 
 export const useStaticPageTags = (initialTags?: ITagNames): SWRResponse<ITagNames, Error> => {
-  // const { data: pageTags } = useSWRxPageTags();
   return useStaticSWR<ITagNames, Error>('pageTags', undefined, { fallbackData: initialTags || [] });
 };