Skip to content

Commit cb9fe60

Browse files
authored
1 parent 183cf6c commit cb9fe60

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/twenty-front/src/modules/page-layout/hooks/useEditPageLayoutWidget.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useCallback } from 'react';
22

3+
import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';
34
import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';
45
import { useSetRecoilComponentState } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentState';
56

@@ -22,6 +23,7 @@ export const useEditPageLayoutWidget = (pageLayoutIdFromProps?: string) => {
2223
);
2324

2425
const { navigatePageLayoutCommandMenu } = useNavigatePageLayoutCommandMenu();
26+
const { closeCommandMenu } = useCommandMenu();
2527

2628
const handleEditWidget = useCallback(
2729
({
@@ -39,6 +41,7 @@ export const useEditPageLayoutWidget = (pageLayoutIdFromProps?: string) => {
3941
pageTitle: t`Edit iFrame`,
4042
resetNavigationStack: true,
4143
});
44+
return;
4245
}
4346

4447
if (widgetType === WidgetType.GRAPH) {
@@ -47,9 +50,16 @@ export const useEditPageLayoutWidget = (pageLayoutIdFromProps?: string) => {
4750
pageTitle: t`Edit Graph`,
4851
resetNavigationStack: true,
4952
});
53+
return;
5054
}
55+
56+
closeCommandMenu();
5157
},
52-
[setPageLayoutEditingWidgetId, navigatePageLayoutCommandMenu],
58+
[
59+
setPageLayoutEditingWidgetId,
60+
navigatePageLayoutCommandMenu,
61+
closeCommandMenu,
62+
],
5363
);
5464

5565
return {

0 commit comments

Comments
 (0)