pl-fe: another supposed modals fix

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-01-07 17:05:13 +01:00
parent 8b3c13a286
commit e217dde4c5
3 changed files with 20 additions and 14 deletions

View File

@ -29,7 +29,7 @@ const checkComposeContent = (compose?: Compose) =>
interface IModalRoot {
onCancel?: () => void;
onClose: (type?: ModalType) => void;
onClose: (type?: ModalType, all?: boolean) => void;
type: ModalType;
children: React.ReactNode;
modalIndex: number;
@ -124,8 +124,8 @@ const ModalRoot: React.FC<IModalRoot> = ({ children, onCancel, onClose, type, mo
const handleModalOpen = () => {
unlistenHistory.current = router.history.subscribe(({ action, location }) => {
if (action.type === 'PUSH' && location.state.modalIndex === undefined) {
onClose();
if ((action.type === 'REPLACE' || action.type === 'PUSH') && location.state.modalIndex === undefined) {
onClose(undefined, true);
}
if (action.type === 'BACK') {
handleOnClose();