ソースを参照

Merge pull request #1523 from visuddhinanda/agile

Agile #1518
visuddhinanda 2 年 前
コミット
ef5c40f76b

+ 0 - 8
dashboard/src/components/article/Article.tsx

@@ -14,8 +14,6 @@ import "./article.css";
 import TocTree from "./TocTree";
 import PaliText from "../template/Wbw/PaliText";
 import ArticleSkeleton from "./ArticleSkeleton";
-
-import { modeChange } from "../../reducers/article-mode";
 import { IViewRequest, IViewStoreResponse } from "../api/view";
 import {
   IRecentRequest,
@@ -131,12 +129,6 @@ const ArticleWidget = ({
     }
   }, [articleId, type]);
 
-  useEffect(() => {
-    //发布mode变更
-    console.log("发布mode变更", mode);
-    store.dispatch(modeChange(mode as ArticleMode));
-  }, [mode]);
-
   const srcDataMode = mode === "edit" || mode === "wbw" ? "edit" : "read";
   useEffect(() => {
     console.log("srcDataMode", srcDataMode);

+ 8 - 0
dashboard/src/pages/library/article/show.tsx

@@ -45,6 +45,7 @@ import {
 } from "../../../reducers/discussion";
 import { openPanel } from "../../../reducers/right-panel";
 import { TResType } from "../../../components/discussion/DiscussionListCard";
+import { modeChange } from "../../../reducers/article-mode";
 
 /**
  * type:
@@ -121,6 +122,13 @@ const Widget = () => {
   } else {
     currMode = "read";
   }
+
+  useEffect(() => {
+    //发布mode变更
+    console.log("发布mode变更", currMode);
+    store.dispatch(modeChange(currMode as ArticleMode));
+  }, [currMode]);
+
   console.log(anchorNavOpen, anchorNavShow);
   const scrollToTop = () => {
     document.getElementById("article-root")?.scrollIntoView();