forked from github/plane
fix: resolve modal overlapping issue (#2885)
This commit is contained in:
parent
6d46771109
commit
70994d1da7
@ -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,
|
||||
]
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user