Skip to content

Commit

Permalink
Merge pull request #1122 from AletheiaFact/hotfix-realase-features
Browse files Browse the repository at this point in the history
HOTFIX: Features releases errors
  • Loading branch information
thesocialdev authored Jan 27, 2024
2 parents 7f42a91 + 33c749c commit 230c20e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/components/Collaborative/Comment/CommentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ const CommentCard = ({
const [isSelected, setIsSelected] = useState(false);

const handleClickCard = () => {
const isCrossCheckingComment = comment.type === "cross-checking";
if (enableEditorAnnotations && comment?.from && comment?.to) {
selectText({ from: comment.from, to: comment.to });
}
setIsSelected(isCrossCheckingComment);
};

return !isResolved ? (
Expand Down
15 changes: 9 additions & 6 deletions src/components/Collaborative/Comment/CommentContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "remirror/styles/all.css";

import React, { useContext, useEffect, useState } from "react";
import React, { useContext, useEffect, useMemo, useState } from "react";
import {
CommandButton,
FloatingToolbar,
Expand Down Expand Up @@ -38,6 +38,13 @@ const CommentContainer = ({ readonly, state }) => {
? addAnnotation?.enabled({ id: "" })
: true;
const annotations = enableEditorAnnotations ? getAnnotations() : null;
const crossCheckingComments = useMemo(
() =>
reviewData?.crossCheckingComments?.filter(
(crossCheckingComment) => !crossCheckingComment?.resolved
),
[reviewData?.crossCheckingComments]
);

useEffect(() => {
if (hasSession) {
Expand All @@ -52,10 +59,6 @@ const CommentContainer = ({ readonly, state }) => {
const reviewComments = reviewData?.reviewComments?.filter(
(comment) => !comment?.resolved
);
const crossCheckingComments =
reviewData?.crossCheckingComments?.filter(
(crossCheckingComment) => !crossCheckingComment?.resolved
);
setComments([
...(reviewComments ? reviewComments : []),
...(crossCheckingComments ? crossCheckingComments : []),
Expand All @@ -71,7 +74,7 @@ const CommentContainer = ({ readonly, state }) => {
) {
setAnnotations(comments);
} else if (comments && state.doc.content.size) {
setComments(annotations);
setComments([...annotations, ...crossCheckingComments]);
}
}
}, [setAnnotations, setComments, state.doc]);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Form/UserInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const UserInput = ({
dataLoader,
mode = "multiple",
style = {},
value = [],
value = null,
preloadedOptions = [],
}: UserInputProps) => {
const [treatedValue, setTreatedValue] = useState([]);
Expand Down
1 change: 0 additions & 1 deletion src/components/Notification/NotificationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const NotificationCard = ({ notification, handleNotificationClick }) => {
setIsSeen(true);
}
if (payload.redirectUrl) {
console.log(payload);
setIsLoading(true);
window.location = payload.redirectUrl;
}
Expand Down

0 comments on commit 230c20e

Please sign in to comment.