fix (#1482)
parent
70683a89b9
commit
d2b9e67424
|
@ -81,6 +81,8 @@ export default function CreateEventTypeButton(props: Props) {
|
||||||
|
|
||||||
// inject selection data into url for correct router history
|
// inject selection data into url for correct router history
|
||||||
const openModal = (option: EventTypeParent) => {
|
const openModal = (option: EventTypeParent) => {
|
||||||
|
// setTimeout fixes a bug where the url query params are removed immediately after opening the modal
|
||||||
|
setTimeout(() => {
|
||||||
router.push({
|
router.push({
|
||||||
pathname: router.pathname,
|
pathname: router.pathname,
|
||||||
query: {
|
query: {
|
||||||
|
@ -94,6 +96,7 @@ export default function CreateEventTypeButton(props: Props) {
|
||||||
: {}),
|
: {}),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// remove url params after close modal to reset state
|
// remove url params after close modal to reset state
|
||||||
|
@ -108,7 +111,6 @@ export default function CreateEventTypeButton(props: Props) {
|
||||||
<Dialog
|
<Dialog
|
||||||
open={modalOpen.isOn}
|
open={modalOpen.isOn}
|
||||||
onOpenChange={(isOpen) => {
|
onOpenChange={(isOpen) => {
|
||||||
router.push(isOpen ? modalOpen.hrefOn : modalOpen.hrefOff);
|
|
||||||
if (!isOpen) closeModal();
|
if (!isOpen) closeModal();
|
||||||
}}>
|
}}>
|
||||||
{!hasTeams || props.isIndividualTeam ? (
|
{!hasTeams || props.isIndividualTeam ? (
|
||||||
|
|
Loading…
Reference in New Issue