Skip to content

Commit

Permalink
fix: eslint rule no conditional hooks OptioRowLHN
Browse files Browse the repository at this point in the history
  • Loading branch information
redpanda-bit committed Sep 29, 2023
1 parent 876f810 commit 1acc828
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/components/LHNOptionsList/OptionRowLHN.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ function OptionRowLHN(props) {
const optionItem = props.optionItem;
const [isContextMenuActive, setIsContextMenuActive] = useState(false);

useFocusEffect(
useCallback(() => {
isFocusedRef.current = true;
return () => {
isFocusedRef.current = false;
};
}, []),
);

if (!optionItem) {
return null;
}
Expand Down Expand Up @@ -108,14 +117,6 @@ function OptionRowLHN(props) {
const shouldShowGreenDotIndicator =
!hasBrickError && (optionItem.isUnreadWithMention || optionItem.isWaitingForTaskCompleteFromAssignee || ReportUtils.isWaitingForIOUActionFromCurrentUser(optionItem));

useFocusEffect(
useCallback(() => {
isFocusedRef.current = true;
return () => {
isFocusedRef.current = false;
};
}, []),
);
/**
* Show the ReportActionContextMenu modal popover.
*
Expand Down

0 comments on commit 1acc828

Please sign in to comment.