Skip to content

Commit

Permalink
Close reservations modal when deleting reservation
Browse files Browse the repository at this point in the history
Upon deleting a reserved material, the user can be stuck in an infinite loop, because the underlying reservations modal is not closed after deleting a reservation. This change always closes the reservationsQueued modal when deleting a reserved material.
  • Loading branch information
JacobArrow committed Nov 1, 2023
1 parent a96e530 commit 49b0f7b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
useDeleteV1UserReservationsIdentifier
} from "../../../../core/publizon/publizon";
import { isFaust, isIdentifier } from "../../../dashboard/util/helpers";
import { getModalIds } from "../../../../core/utils/helpers/general";

interface DeleteReservationModalProps {
modalId: string;
Expand All @@ -28,6 +29,7 @@ const DeleteReservationModal: FC<DeleteReservationModalProps> = ({
const { mutate: deleteDigitalReservation } =
useDeleteV1UserReservationsIdentifier();
const { close } = useModalButtonHandler();
const { reservationsQueued } = getModalIds();

const removeSelectedReservations = () => {
if (reservations.length > 0) {
Expand Down Expand Up @@ -65,6 +67,7 @@ const DeleteReservationModal: FC<DeleteReservationModalProps> = ({
)
);

close(reservationsQueued as string);
close(modalId as string);
}
};
Expand Down

0 comments on commit 49b0f7b

Please sign in to comment.