Skip to content

The open alternative to Salesforce, designed for AI.

Fix infinite loop when opening relation picker in comments pane (#548)

Emilien Chauvet49c20907e876
diff --git a/front/src/modules/comments/components/CommentThreadRelationPicker.tsx b/front/src/modules/comments/components/CommentThreadRelationPicker.tsx
index 97aeedab8ba..93a32afd2f2 100644
--- a/front/src/modules/comments/components/CommentThreadRelationPicker.tsx
+++ b/front/src/modules/comments/components/CommentThreadRelationPicker.tsx
@@ -12,7 +12,6 @@ import { IconArrowUpRight } from '@tabler/icons-react';
import { CommentThreadForDrawer } from '@/comments/types/CommentThreadForDrawer';
import CompanyChip from '@/companies/components/CompanyChip';
-import { useHotkeysScopeOnBooleanState } from '@/hotkeys/hooks/useHotkeysScopeOnBooleanState';
import { useScopedHotkeys } from '@/hotkeys/hooks/useScopedHotkeys';
import { InternalHotkeysScope } from '@/hotkeys/types/internal/InternalHotkeysScope';
import { PersonChip } from '@/people/components/PersonChip';
@@ -98,11 +97,6 @@ export function CommentThreadRelationPicker({ commentThread }: OwnProps) {
const [isMenuOpen, setIsMenuOpen] = useState(false);
const [searchFilter, setSearchFilter] = useState('');
- useHotkeysScopeOnBooleanState(
- { scope: InternalHotkeysScope.RelationPicker },
- isMenuOpen,
- );
-
const theme = useTheme();
const peopleIds =
diff --git a/front/src/modules/hotkeys/hooks/useHotkeysScopeOnBooleanState.ts b/front/src/modules/hotkeys/hooks/useHotkeysScopeOnBooleanState.ts
index 2b82da13888..fd0eb74c4fa 100644
--- a/front/src/modules/hotkeys/hooks/useHotkeysScopeOnBooleanState.ts
+++ b/front/src/modules/hotkeys/hooks/useHotkeysScopeOnBooleanState.ts
@@ -10,17 +10,17 @@ export function useHotkeysScopeOnBooleanState(
booleanState: boolean,
) {
const addToHotkeysScopeStack = useAddToHotkeysScopeStack();
- const removeFromHoteysScopeStack = useRemoveFromHotkeysScopeStack();
+ const removeFromHotkeysScopeStack = useRemoveFromHotkeysScopeStack();
useEffect(() => {
if (booleanState) {
addToHotkeysScopeStack(hotkeysScopeStackItem);
} else {
- removeFromHoteysScopeStack(hotkeysScopeStackItem.scope);
+ removeFromHotkeysScopeStack(hotkeysScopeStackItem.scope);
}
}, [
hotkeysScopeStackItem,
- removeFromHoteysScopeStack,
+ removeFromHotkeysScopeStack,
addToHotkeysScopeStack,
booleanState,
]);