Просмотр исходного кода

Merge pull request #7095 from weseek/fix/wideview-not-reflected-new

fix: WideView Setting on ShareLink mode is not reflected
Yuki Takei 3 лет назад
Родитель
Сommit
99fdf1fe5b
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      packages/app/src/client/services/use-current-layout-class-name.ts

+ 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 { useEditorMode } from '~/stores/ui';
 
 export const useCurrentLayoutClassName = (): string => {
-  const { data: currentPage } = useSWRxCurrentPage();
+  const { data: shareLinkId } = useShareLinkId();
+  const { data: currentPage } = useSWRxCurrentPage(shareLinkId ?? undefined);
 
   const { data: dataIsContainerFluid } = useIsContainerFluid();
   const { getClassNamesByEditorMode } = useEditorMode();