@inertiaui/modal-react 0.6.2 → 0.6.4
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.
- package/dist/inertiaui-modal.js +483 -481
- package/dist/inertiaui-modal.umd.cjs +12 -12
- package/package.json +1 -1
- package/src/ModalRoot.jsx +5 -1
package/package.json
CHANGED
package/src/ModalRoot.jsx
CHANGED
|
@@ -224,6 +224,7 @@ export const ModalStackProvider = ({ children }) => {
|
|
|
224
224
|
'X-Inertia-Partial-Data': keys.join(','),
|
|
225
225
|
'X-InertiaUI-Modal': true,
|
|
226
226
|
'X-InertiaUI-Modal-Use-Router': 0,
|
|
227
|
+
'X-InertiaUI-Modal-Base-Url': baseUrl,
|
|
227
228
|
},
|
|
228
229
|
}).then((response) => {
|
|
229
230
|
this.updateProps(response.data.props)
|
|
@@ -308,6 +309,7 @@ export const ModalStackProvider = ({ children }) => {
|
|
|
308
309
|
'X-Inertia-Version': pageVersion,
|
|
309
310
|
'X-InertiaUI-Modal': true,
|
|
310
311
|
'X-InertiaUI-Modal-Use-Router': useInertiaRouter ? 1 : 0,
|
|
312
|
+
'X-InertiaUI-Modal-Base-Url': baseUrl,
|
|
311
313
|
}
|
|
312
314
|
|
|
313
315
|
if (useInertiaRouter) {
|
|
@@ -489,7 +491,9 @@ export const ModalRoot = ({ children }) => {
|
|
|
489
491
|
const axiosRequestInterceptor = (config) => {
|
|
490
492
|
// A Modal is opened on top of a base route, so we need to pass this base route
|
|
491
493
|
// so it can redirect back with the back() helper method...
|
|
492
|
-
|
|
494
|
+
if (localStackCopy.length) {
|
|
495
|
+
config.headers['X-InertiaUI-Modal-Base-Url'] = baseUrl
|
|
496
|
+
}
|
|
493
497
|
return config
|
|
494
498
|
}
|
|
495
499
|
|