fix: resolve modal overlapping issue (#2885)

This commit is contained in:
Anmol Singh Bhatia 2023-11-27 12:16:59 +05:30 committed by sriram veeraghanta
parent 6d46771109
commit 70994d1da7

View File

@ -33,7 +33,7 @@ export const CommandPalette: FC = observer(() => {
commandPalette,
theme: { toggleSidebar },
user: { currentUser },
trackEvent: { setTrackElement }
trackEvent: { setTrackElement },
} = useMobxStore();
const {
toggleCommandPaletteModal,
@ -57,6 +57,18 @@ export const CommandPalette: FC = observer(() => {
toggleDeleteIssueModal,
} = commandPalette;
const isAnyModalOpen = Boolean(
isCreateIssueModalOpen ||
isCreateCycleModalOpen ||
isCreatePageModalOpen ||
isCreateProjectModalOpen ||
isCreateModuleModalOpen ||
isCreateViewModalOpen ||
isShortcutModalOpen ||
isBulkDeleteIssueModalOpen ||
isDeleteIssueModalOpen
);
const { setToastAlert } = useToast();
const { data: issueDetails } = useSWR(
@ -111,7 +123,7 @@ export const CommandPalette: FC = observer(() => {
e.preventDefault();
toggleSidebar();
}
} else {
} else if (!isAnyModalOpen) {
if (keyPressed === "c") {
setTrackElement("SHORTCUT_KEY");
toggleCreateIssueModal(true);
@ -148,6 +160,7 @@ export const CommandPalette: FC = observer(() => {
toggleCreateIssueModal,
projectId,
workspaceSlug,
isAnyModalOpen,
]
);