kaori %!s(int64=3) %!d(string=hai) anos
pai
achega
7bf55ee141

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

@@ -87,6 +87,7 @@ const PageEditor = (props: Props): JSX.Element => {
   const { data: isMobile } = useIsMobile();
   const { data: isMobile } = useIsMobile();
   const { data: isSlackEnabled } = useIsSlackEnabled();
   const { data: isSlackEnabled } = useIsSlackEnabled();
   const { data: pageId } = useCurrentPageId();
   const { data: pageId } = useCurrentPageId();
+  const { data: pageTags } = useStaticPageTags(pageId);
   const { data: tagsInfoData } = useStaticPageTags(pageId);
   const { data: tagsInfoData } = useStaticPageTags(pageId);
   const { data: currentPagePath } = useCurrentPagePath();
   const { data: currentPagePath } = useCurrentPagePath();
   const { data: slackChannelsData } = useSWRxSlackChannels(currentPagePath);
   const { data: slackChannelsData } = useSWRxSlackChannels(currentPagePath);
@@ -125,7 +126,7 @@ const PageEditor = (props: Props): JSX.Element => {
 
 
     const slackChannels = slackChannelsData ? slackChannelsData.toString() : '';
     const slackChannels = slackChannelsData ? slackChannelsData.toString() : '';
 
 
-    const optionsToSave = getOptionsToSave(isSlackEnabled ?? false, slackChannels, grant, grantGroupId, grantGroupName, tagsInfoData?.tags || []);
+    const optionsToSave = getOptionsToSave(isSlackEnabled ?? false, slackChannels, grant, grantGroupId, grantGroupName, pageTags || []);
 
 
     try {
     try {
       // disable unsaved warning
       // disable unsaved warning

+ 7 - 5
packages/app/src/stores/editor.tsx

@@ -5,9 +5,10 @@ import { apiGet } from '~/client/util/apiv1-client';
 import { apiv3Get, apiv3Put } from '~/client/util/apiv3-client';
 import { apiv3Get, apiv3Put } from '~/client/util/apiv3-client';
 import { Nullable } from '~/interfaces/common';
 import { Nullable } from '~/interfaces/common';
 import { IEditorSettings } from '~/interfaces/editor-settings';
 import { IEditorSettings } from '~/interfaces/editor-settings';
-import { IResGetPageTags } from '~/interfaces/tag';
+import { ITagNames } from '~/interfaces/tag';
 import { SlackChannels } from '~/interfaces/user-trigger-notification';
 import { SlackChannels } from '~/interfaces/user-trigger-notification';
-import { useSWRxTagsInfo } from '~/stores/page';
+// import { useSWRxTagsInfo } from '~/stores/page';
+import { useSWRxPageTags } from '~/stores/tag';
 
 
 import {
 import {
   useCurrentUser, useDefaultIndentSize, useIsGuestUser,
   useCurrentUser, useDefaultIndentSize, useIsGuestUser,
@@ -93,7 +94,8 @@ export const useIsSlackEnabled = (): SWRResponse<boolean, Error> => {
   );
   );
 };
 };
 
 
-export const useStaticPageTags = (pageId: string | null | undefined): SWRResponse<IResGetPageTags['tags'], Error> => {
-  const { data: pageTags } = useSWRxTagsInfo(pageId);
-  return useStaticSWR<IResGetPageTags['tags'], Error>('pageTags', pageTags || [], { fallbackData: [] });
+export const useStaticPageTags = (pageId: string | null | undefined): SWRResponse<ITagNames, Error> => {
+  const { data: pageTags } = useSWRxPageTags();
+  console.log('pageTags_hoge', pageTags);
+  return useStaticSWR<ITagNames, Error>('pageTags', pageTags || [], { fallbackData: pageTags });
 };
 };