|
@@ -8,10 +8,9 @@ import dynamic from 'next/dynamic';
|
|
|
|
|
|
|
|
import { HtmlElementNode } from 'rehype-toc';
|
|
import { HtmlElementNode } from 'rehype-toc';
|
|
|
|
|
|
|
|
-import { blinkSectionHeaderAtBoot } from '~/client/util/blink-section-header';
|
|
|
|
|
// import { getOptionsToSave } from '~/client/util/editor';
|
|
// import { getOptionsToSave } from '~/client/util/editor';
|
|
|
import {
|
|
import {
|
|
|
- useIsGuestUser, useIsBlinkedHeaderAtBoot, useCurrentPageTocNode,
|
|
|
|
|
|
|
+ useIsGuestUser, useCurrentPageTocNode,
|
|
|
} from '~/stores/context';
|
|
} from '~/stores/context';
|
|
|
import {
|
|
import {
|
|
|
useSWRxSlackChannels, useIsSlackEnabled, usePageTagsForEditors, useIsEnabledUnsavedWarning,
|
|
useSWRxSlackChannels, useIsSlackEnabled, usePageTagsForEditors, useIsEnabledUnsavedWarning,
|
|
@@ -210,20 +209,10 @@ export const Page = (props) => {
|
|
|
const { data: pageTags } = usePageTagsForEditors(null); // TODO: pass pageId
|
|
const { data: pageTags } = usePageTagsForEditors(null); // TODO: pass pageId
|
|
|
const { data: rendererOptions } = useViewOptions(storeTocNodeHandler);
|
|
const { data: rendererOptions } = useViewOptions(storeTocNodeHandler);
|
|
|
const { mutate: mutateIsEnabledUnsavedWarning } = useIsEnabledUnsavedWarning();
|
|
const { mutate: mutateIsEnabledUnsavedWarning } = useIsEnabledUnsavedWarning();
|
|
|
- const { data: isBlinkedAtBoot, mutate: mutateBlinkedAtBoot } = useIsBlinkedHeaderAtBoot();
|
|
|
|
|
const { mutate: mutateCurrentPageTocNode } = useCurrentPageTocNode();
|
|
const { mutate: mutateCurrentPageTocNode } = useCurrentPageTocNode();
|
|
|
|
|
|
|
|
const pageRef = useRef(null);
|
|
const pageRef = useRef(null);
|
|
|
|
|
|
|
|
- useEffect(() => {
|
|
|
|
|
- if (isBlinkedAtBoot) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- blinkSectionHeaderAtBoot();
|
|
|
|
|
- mutateBlinkedAtBoot(true);
|
|
|
|
|
- }, [isBlinkedAtBoot, mutateBlinkedAtBoot]);
|
|
|
|
|
-
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
mutateCurrentPageTocNode(tocRef.current);
|
|
mutateCurrentPageTocNode(tocRef.current);
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|