Browse Source

retreve currentPage

kaori 3 years ago
parent
commit
ebb2a20000

+ 3 - 2
packages/app/src/client/services/use-current-layout-class-name.ts

@@ -1,9 +1,10 @@
-import { useIsContainerFluid } from '~/stores/context';
+import { useIsContainerFluid, useShareLinkId } from '~/stores/context';
 import { useSWRxCurrentPage } from '~/stores/page';
 import { useSWRxCurrentPage } from '~/stores/page';
 import { useEditorMode } from '~/stores/ui';
 import { useEditorMode } from '~/stores/ui';
 
 
 export const useCurrentLayoutClassName = (): string => {
 export const useCurrentLayoutClassName = (): string => {
-  const { data: currentPage } = useSWRxCurrentPage();
+  const { data: shareLinkId } = useShareLinkId();
+  const { data: currentPage } = useSWRxCurrentPage(shareLinkId ?? undefined);
 
 
   const { data: dataIsContainerFluid } = useIsContainerFluid();
   const { data: dataIsContainerFluid } = useIsContainerFluid();
   const { getClassNamesByEditorMode } = useEditorMode();
   const { getClassNamesByEditorMode } = useEditorMode();