Explorar o código

点 显示译文 锚点高亮

visuddhinanda %!s(int64=2) %!d(string=hai) anos
pai
achega
09a8ed84f4
Modificáronse 1 ficheiros con 16 adicións e 10 borrados
  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));
         }}
       >
         显示译文