Parcourir la source

Reduce code change

Taichi Masuyama il y a 3 ans
Parent
commit
76e4553e4a

+ 2 - 2
packages/app/src/components/Page.tsx

@@ -190,8 +190,6 @@ class PageSubstance extends React.Component<PageSubstanceProps> {
 }
 }
 
 
 export const Page = (props) => {
 export const Page = (props) => {
-  const pageRef = useRef(null);
-
   const { data: currentPage } = useSWRxCurrentPage();
   const { data: currentPage } = useSWRxCurrentPage();
   const { data: editorMode } = useEditorMode();
   const { data: editorMode } = useEditorMode();
   const { data: isGuestUser } = useIsGuestUser();
   const { data: isGuestUser } = useIsGuestUser();
@@ -203,6 +201,8 @@ export const Page = (props) => {
   const { mutate: mutateIsEnabledUnsavedWarning } = useIsEnabledUnsavedWarning();
   const { mutate: mutateIsEnabledUnsavedWarning } = useIsEnabledUnsavedWarning();
   const { data: isBlinkedAtBoot, mutate: mutateBlinkedAtBoot } = useIsBlinkedHeaderAtBoot();
   const { data: isBlinkedAtBoot, mutate: mutateBlinkedAtBoot } = useIsBlinkedHeaderAtBoot();
 
 
+  const pageRef = useRef(null);
+
   useEffect(() => {
   useEffect(() => {
     if (isBlinkedAtBoot) {
     if (isBlinkedAtBoot) {
       return;
       return;

+ 1 - 0
packages/app/src/services/renderer/renderer.ts

@@ -285,6 +285,7 @@ export const generateViewOptions = (
         replacer([toc]); // replace <ol> to <ul>
         replacer([toc]); // replace <ol> to <ul>
 
 
         // For storing tocNode to global state with swr
         // For storing tocNode to global state with swr
+        // search: tocRef.current
         tocRef.current = toc;
         tocRef.current = toc;
 
 
         return false; // not show toc in body
         return false; // not show toc in body