peckadesign / pd-naja

1 stars 0 forks source link

fix: Better detection of initial state #21

Closed zipper closed 4 months ago

zipper commented 4 months ago

The pdModal is not stored in the state if it is the initial state created in Naja's replaceInitialState. After the Naja update to 2.6.0 it is easier to detect the initial state and prevent the pdModal from being saved in it. This is especially helpful when a non-ajax modal is opened and then navigated. Previously, this was incorrectly detected as a PdModal state because PdModal was already open. Now, in this case, the state correctly contains no pdModal, as the non-ajax modal should never appear in the history (and if it does, it shouldn't be handled by the AjaxModalExtension anyway).