Explorar o código

if (discussionMessage &&

visuddhinanda %!s(int64=2) %!d(string=hai) anos
pai
achega
daaf9e88e4
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 anchorInfo = useAppSelector(anchor);
   const sid = `${sentData?.book}_${sentData?.para}_${sentData?.wordStart}_${sentData?.wordEnd}_${sentData?.channel.id}`;
   const sid = `${sentData?.book}_${sentData?.para}_${sentData?.wordStart}_${sentData?.wordEnd}_${sentData?.channel.id}`;
   useEffect(() => {
   useEffect(() => {
-    if (discussionMessage?.resId === initValue?.id) {
+    if (discussionMessage && discussionMessage.resId === initValue?.id) {
       setBgColor("wheat");
       setBgColor("wheat");
     } else {
     } else {
       setBgColor("unset");
       setBgColor("unset");
@@ -54,7 +54,7 @@ const SentCellWidget = ({
   }, [discussionMessage?.resId, initValue?.id]);
   }, [discussionMessage?.resId, initValue?.id]);
 
 
   useEffect(() => {
   useEffect(() => {
-    if (anchorInfo?.resId === initValue?.id) {
+    if (anchorInfo && anchorInfo?.resId === initValue?.id) {
       const ele = document.getElementById(sid);
       const ele = document.getElementById(sid);
       ele?.scrollIntoView();
       ele?.scrollIntoView();
     }
     }