@inertiaui/modal-react 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
const savedBaseUrl = baseUrl;
|
|
255
255
|
baseUrl = null;
|
|
256
256
|
closingToBaseUrlTarget = savedBaseUrl;
|
|
257
|
-
if (savedBaseUrl && typeof window !== "undefined") {
|
|
257
|
+
if (savedBaseUrl && typeof window !== "undefined" && !vanilla.sameUrlPath(savedBaseUrl, window.location.href)) {
|
|
258
258
|
react.router.push({
|
|
259
259
|
url: savedBaseUrl,
|
|
260
260
|
preserveScroll: true,
|
|
@@ -755,7 +755,7 @@
|
|
|
755
755
|
}, [modalContext]);
|
|
756
756
|
const previousIsOpenRef = React.useRef(void 0);
|
|
757
757
|
React.useEffect(() => {
|
|
758
|
-
if (modalContext
|
|
758
|
+
if (modalContext != null) {
|
|
759
759
|
if (modalContext.isOpen) {
|
|
760
760
|
onSuccess?.();
|
|
761
761
|
} else if (previousIsOpenRef.current === true) {
|
|
@@ -766,7 +766,7 @@
|
|
|
766
766
|
}, [modalContext?.isOpen]);
|
|
767
767
|
const [rendered, setRendered] = React.useState(false);
|
|
768
768
|
React.useEffect(() => {
|
|
769
|
-
if (rendered && modalContext
|
|
769
|
+
if (rendered && modalContext != null && modalContext.isOpen) {
|
|
770
770
|
if (modalContext.onTopOfStack) {
|
|
771
771
|
onFocus?.();
|
|
772
772
|
} else {
|