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

Merge pull request #1472 from visuddhinanda/agile

点 显示译文 锚点高亮
visuddhinanda 2 лет назад
Родитель
Сommit
4bad2bec83
1 измененных файлов с 16 добавлено и 10 удалено
  1. 16 10
      dashboard/src/components/discussion/DiscussionBox.tsx

+ 16 - 10
dashboard/src/components/discussion/DiscussionBox.tsx

@@ -5,7 +5,13 @@ import DiscussionTopic from "./DiscussionTopic";
 import DiscussionListCard from "./DiscussionListCard";
 import { IComment } from "./DiscussionItem";
 import { useAppSelector } from "../../hooks";
-import { countChange, message, showAnchor } from "../../reducers/discussion";
+import {
+  countChange,
+  IShowDiscussion,
+  message,
+  show,
+  showAnchor,
+} from "../../reducers/discussion";
 import { Button } from "antd";
 import store from "../../store";
 
@@ -39,15 +45,15 @@ const DiscussionBoxWidget = () => {
       <Button
         type="link"
         onClick={() => {
-          store.dispatch(
-            showAnchor({
-              type: "discussion",
-              resId: discussionMessage?.resId
-                ? discussionMessage?.resId
-                : currTopic?.resId,
-              resType: discussionMessage?.resType,
-            })
-          );
+          const anchorInfo: IShowDiscussion = {
+            type: "discussion",
+            resId: discussionMessage?.resId
+              ? discussionMessage?.resId
+              : currTopic?.resId,
+            resType: discussionMessage?.resType,
+          };
+          store.dispatch(show(anchorInfo));
+          store.dispatch(showAnchor(anchorInfo));
         }}
       >
         显示译文