@hybridly/core 0.0.1-alpha.23 → 0.0.1-alpha.24

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/index.cjs CHANGED
@@ -464,6 +464,7 @@ async function initializeContext(options) {
464
464
  state.initialized = true;
465
465
  state.context = {
466
466
  ...options.payload,
467
+ responseErrorModals: options.responseErrorModals,
467
468
  serializer: createSerializer(options),
468
469
  url: makeUrl(options.payload.url).toString(),
469
470
  adapter: {
@@ -731,7 +732,9 @@ async function performHybridNavigation(options) {
731
732
  utils.debug.router("The request was not hybridly.");
732
733
  console.error(error);
733
734
  await runHooks("invalid", options.hooks, error, context);
734
- utils.showResponseErrorModal(error.response.data);
735
+ if (context.responseErrorModals) {
736
+ utils.showResponseErrorModal(error.response.data);
737
+ }
735
738
  },
736
739
  default: async () => {
737
740
  utils.debug.router("An unknown error occured.", error);
package/dist/index.d.ts CHANGED
@@ -330,6 +330,8 @@ interface RouterContextOptions {
330
330
  axios?: Axios;
331
331
  /** Initial routing configuration. */
332
332
  routing?: RoutingConfiguration;
333
+ /** Whether to display response error modals. */
334
+ responseErrorModals?: boolean;
333
335
  }
334
336
  /** Router context. */
335
337
  interface InternalRouterContext {
@@ -359,6 +361,8 @@ interface InternalRouterContext {
359
361
  axios: Axios;
360
362
  /** Routing configuration. */
361
363
  routing?: RoutingConfiguration;
364
+ /** Whether to display response error modals. */
365
+ responseErrorModals?: boolean;
362
366
  }
363
367
  /** Router context. */
364
368
  type RouterContext = Readonly<InternalRouterContext>;
package/dist/index.mjs CHANGED
@@ -455,6 +455,7 @@ async function initializeContext(options) {
455
455
  state.initialized = true;
456
456
  state.context = {
457
457
  ...options.payload,
458
+ responseErrorModals: options.responseErrorModals,
458
459
  serializer: createSerializer(options),
459
460
  url: makeUrl(options.payload.url).toString(),
460
461
  adapter: {
@@ -722,7 +723,9 @@ async function performHybridNavigation(options) {
722
723
  debug.router("The request was not hybridly.");
723
724
  console.error(error);
724
725
  await runHooks("invalid", options.hooks, error, context);
725
- showResponseErrorModal(error.response.data);
726
+ if (context.responseErrorModals) {
727
+ showResponseErrorModal(error.response.data);
728
+ }
726
729
  },
727
730
  default: async () => {
728
731
  debug.router("An unknown error occured.", error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hybridly/core",
3
- "version": "0.0.1-alpha.23",
3
+ "version": "0.0.1-alpha.24",
4
4
  "description": "A solution to develop server-driven, client-rendered applications",
5
5
  "keywords": [
6
6
  "hybridly",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "qs": "^6.11.0",
40
- "@hybridly/utils": "0.0.1-alpha.23"
40
+ "@hybridly/utils": "0.0.1-alpha.24"
41
41
  },
42
42
  "devDependencies": {
43
43
  "defu": "^6.1.2"