Explorar o código

Merge pull request #1439 from visuddhinanda/agile

if (discussionMessage &&
visuddhinanda %!s(int64=2) %!d(string=hai) anos
pai
achega
53a166b0de
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      dashboard/src/components/template/SentEdit/SentCell.tsx

+ 2 - 2
dashboard/src/components/template/SentEdit/SentCell.tsx

@@ -46,7 +46,7 @@ const SentCellWidget = ({
   const anchorInfo = useAppSelector(anchor);
   const sid = `${sentData?.book}_${sentData?.para}_${sentData?.wordStart}_${sentData?.wordEnd}_${sentData?.channel.id}`;
   useEffect(() => {
-    if (discussionMessage?.resId === initValue?.id) {
+    if (discussionMessage && discussionMessage.resId === initValue?.id) {
       setBgColor("wheat");
     } else {
       setBgColor("unset");
@@ -54,7 +54,7 @@ const SentCellWidget = ({
   }, [discussionMessage?.resId, initValue?.id]);
 
   useEffect(() => {
-    if (anchorInfo?.resId === initValue?.id) {
+    if (anchorInfo && anchorInfo?.resId === initValue?.id) {
       const ele = document.getElementById(sid);
       ele?.scrollIntoView();
     }