@uxland/primary-shell 7.46.9 → 7.46.11

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.
@@ -1,2 +1,2 @@
1
1
  import { PrimariaApi } from '../../api/api';
2
- export declare const getVisiId: (api: PrimariaApi) => Promise<string>;
2
+ export declare const getVisiId: (api: PrimariaApi) => Promise<string | undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxland/primary-shell",
3
- "version": "7.46.9",
3
+ "version": "7.46.11",
4
4
  "description": "Primaria Shell",
5
5
  "author": "UXLand <dev@uxland.es>",
6
6
  "homepage": "https://github.com/uxland/harmonix/tree/app#readme",
@@ -72,7 +72,7 @@ const doctorNavMenuItems: MenuItemConfig[] = [
72
72
  label: "Prescripció",
73
73
  callbackFn: async () => {
74
74
  const visiId = await getVisiId(shellApi);
75
- navigateToEcap("PRESCRIPCIO_ACTIVA", "NO_TANCAR", { VisiId: visiId });
75
+ navigateToEcap("PRESCRIPCIO_ACTIVA", "NO_TANCAR", visiId ? { VisiId: visiId } : {});
76
76
  },
77
77
  },
78
78
  {
@@ -108,7 +108,7 @@ const doctorNavMenuItems: MenuItemConfig[] = [
108
108
  sortHint: "0100",
109
109
  callbackFn: async () => {
110
110
  const visiId = await getVisiId(shellApi);
111
- navigateToEcap("REV_IT", "NO_TANCAR", { VisiId: visiId });
111
+ navigateToEcap("REV_IT", "NO_TANCAR", visiId ? { VisiId: visiId } : {});
112
112
  },
113
113
  },
114
114
  {
@@ -1,7 +1,11 @@
1
1
  import { PrimariaApi } from "../../api/api";
2
2
 
3
- export const getVisiId = async (api: PrimariaApi): Promise<string> => {
3
+ export const getVisiId = async (api: PrimariaApi): Promise<string | undefined> => {
4
4
  const context = api.contextManager.getContext();
5
5
  if (context.visi_id) return context.visi_id as string;
6
- return (await api.broker.send("get_visi_id")) as string;
6
+ try {
7
+ return (await api.broker.send("get_visi_id")) as string;
8
+ } catch {
9
+ return undefined;
10
+ }
7
11
  };