forked from github/plane
fix: resolve modal overlapping issue (#2885)
This commit is contained in:
parent
202ecd21df
commit
eb78fd6088
@ -33,7 +33,7 @@ export const CommandPalette: FC = observer(() => {
|
|||||||
commandPalette,
|
commandPalette,
|
||||||
theme: { toggleSidebar },
|
theme: { toggleSidebar },
|
||||||
user: { currentUser },
|
user: { currentUser },
|
||||||
trackEvent: { setTrackElement }
|
trackEvent: { setTrackElement },
|
||||||
} = useMobxStore();
|
} = useMobxStore();
|
||||||
const {
|
const {
|
||||||
toggleCommandPaletteModal,
|
toggleCommandPaletteModal,
|
||||||
@ -57,6 +57,18 @@ export const CommandPalette: FC = observer(() => {
|
|||||||
toggleDeleteIssueModal,
|
toggleDeleteIssueModal,
|
||||||
} = commandPalette;
|
} = commandPalette;
|
||||||
|
|
||||||
|
const isAnyModalOpen = Boolean(
|
||||||
|
isCreateIssueModalOpen ||
|
||||||
|
isCreateCycleModalOpen ||
|
||||||
|
isCreatePageModalOpen ||
|
||||||
|
isCreateProjectModalOpen ||
|
||||||
|
isCreateModuleModalOpen ||
|
||||||
|
isCreateViewModalOpen ||
|
||||||
|
isShortcutModalOpen ||
|
||||||
|
isBulkDeleteIssueModalOpen ||
|
||||||
|
isDeleteIssueModalOpen
|
||||||
|
);
|
||||||
|
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
|
|
||||||
const { data: issueDetails } = useSWR(
|
const { data: issueDetails } = useSWR(
|
||||||
@ -111,7 +123,7 @@ export const CommandPalette: FC = observer(() => {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
toggleSidebar();
|
toggleSidebar();
|
||||||
}
|
}
|
||||||
} else {
|
} else if (!isAnyModalOpen) {
|
||||||
if (keyPressed === "c") {
|
if (keyPressed === "c") {
|
||||||
setTrackElement("SHORTCUT_KEY");
|
setTrackElement("SHORTCUT_KEY");
|
||||||
toggleCreateIssueModal(true);
|
toggleCreateIssueModal(true);
|
||||||
@ -148,6 +160,7 @@ export const CommandPalette: FC = observer(() => {
|
|||||||
toggleCreateIssueModal,
|
toggleCreateIssueModal,
|
||||||
projectId,
|
projectId,
|
||||||
workspaceSlug,
|
workspaceSlug,
|
||||||
|
isAnyModalOpen,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user