@inertiaui/modal-react 0.6.2 → 0.6.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@inertiaui/modal-react",
3
3
  "author": "Pascal Baljet <pascal@protone.media>",
4
- "version": "0.6.2",
4
+ "version": "0.6.3",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "type": "module",
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
- config.headers['X-InertiaUI-Modal-Base-Url'] = baseUrl
494
+ if (localStackCopy.length) {
495
+ config.headers['X-InertiaUI-Modal-Base-Url'] = baseUrl
496
+ }
493
497
  return config
494
498
  }
495
499