bt-core-app 1.4.156 → 1.4.158

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.
@@ -29835,14 +29835,18 @@ function MM() {
29835
29835
  }
29836
29836
  const sy = Symbol(), _M = Symbol(), oy = Symbol(), uy = Symbol();
29837
29837
  function U_(e, t, n) {
29838
- const a = Ne(sy), r = Ne(uy), l = Ne(oy), i = a.findItem(e.meta.nav ?? e.name) ?? void 0, s = e.meta.requiresAuth !== !1 || (i == null ? void 0 : i.requiresAuth) !== !1, u = e.query.isTraining === "true";
29838
+ const a = Ne(sy), r = Ne(uy), l = Ne(oy), i = a.findItem(e.meta.nav ?? e.name) ?? void 0, s = e.meta.requiresAuth !== !1 || i != null && i.requiresAuth !== !1, u = e.query.isDemo === "true";
29839
29839
  if (a.updateHistory(e, t), !s)
29840
- return a.updateNavigationProperties(i), e;
29841
- if (u)
29842
- return r.logout(), l.startDemo(), e;
29843
- if (l.endDemo(), r.tryLogin()) {
29840
+ a.updateNavigationProperties(i);
29841
+ else if (u)
29842
+ r.isLoggedIn.value && r.logout(), l.isDemoing.value || l.startDemo();
29843
+ else if (l.isDemoing.value && l.endDemo(), r.tryLogin()) {
29844
29844
  const c = (i == null ? void 0 : i.subscriptions) ?? [], h = (i == null ? void 0 : i.permissions) ?? [];
29845
- return r.doShow(c, h, "view") ? (a.updateNavigationProperties(i), e) : n;
29845
+ if (r.doShow(c, h, "view")) {
29846
+ a.updateNavigationProperties(i);
29847
+ return;
29848
+ } else
29849
+ return n;
29846
29850
  } else
29847
29851
  return r.login(window.location.pathname), a.updateNavigationProperties(i), n;
29848
29852
  }
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ import { Ref } from 'vue';
12
12
  import { RemovableRef } from '@vueuse/core';
13
13
  import { RouteLocation } from 'vue-router';
14
14
  import { RouteLocationNormalized } from 'vue-router';
15
+ import { RouteLocationRaw } from 'vue-router';
15
16
  import { Router } from 'vue-router';
16
17
  import { ShallowRef } from 'vue';
17
18
  import { Store } from 'pinia';
@@ -555,7 +556,7 @@ export declare interface GroupedHeaderOption {
555
556
  values: TableColumn[];
556
557
  }
557
558
 
558
- export declare function guardRoute(to: RouteLocation, from: RouteLocation, restrictedRoute: RouteLocation): RouteLocation;
559
+ export declare function guardRoute(to: RouteLocationNormalized, from: RouteLocationNormalized, restrictedRoute: RouteLocationRaw): RouteLocationRaw | undefined;
559
560
 
560
561
  /**tests for whether string is contains in any of the given props of the given value */
561
562
  export declare function hasSearch(value: any, str?: string, props?: string[]): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bt-core-app",
3
- "version": "1.4.156",
3
+ "version": "1.4.158",
4
4
  "description": "Core app tools for some basic features like navigation, authentication, server apis, and cosmetics",
5
5
  "homepage": "https://github.com/BlitzItTech/bt-core",
6
6
  "bugs": {