@crystaltech/hsms-shared-ui 0.6.9-alpha-10 → 0.6.9-alpha-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.
package/dist/index.es.js CHANGED
@@ -28910,17 +28910,9 @@ const dL = () => {
28910
28910
  userManage: e,
28911
28911
  logoutHandler: t
28912
28912
  }) => {
28913
- const [n, r] = Ke(null), [i, a] = Ke(!1), { user: s } = e, { logoutFromSkh: l } = dL(), c = () => {
28914
- try {
28915
- const p = window.location.origin, f = window.location.pathname.toLowerCase(), m = JSON.parse(localStorage.getItem("hospital_info") || "{}"), A = ((m == null ? void 0 : m.facilityId) || "").toLowerCase(), h = f.match(/\/hsms\/(\w+)/), b = h ? h[1] : "";
28916
- let v = p + "/";
28917
- return b === "emergency" ? v = `${p}/hsms/registration/` : A && f.startsWith(`/${A}`) ? v = `${p}/${A}` : b && (v = `${p}/hsms/${b}/`), v.endsWith("/") || (v += "/"), `${v}login`;
28918
- } catch {
28919
- return "/login";
28920
- }
28921
- }, u = (p) => {
28922
- r(p.currentTarget), a(!0);
28923
- }, d = () => {
28913
+ const [n, r] = Ke(null), [i, a] = Ke(!1), { user: s } = e, { logoutFromSkh: l } = dL(), c = (d) => {
28914
+ r(d.currentTarget), a(!0);
28915
+ }, u = () => {
28924
28916
  a(!1);
28925
28917
  };
28926
28918
  return /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
@@ -28929,7 +28921,7 @@ const dL = () => {
28929
28921
  /* @__PURE__ */ g.jsxs(
28930
28922
  zs,
28931
28923
  {
28932
- onClick: u,
28924
+ onClick: c,
28933
28925
  sx: {
28934
28926
  display: "flex",
28935
28927
  alignItems: "center",
@@ -28996,7 +28988,7 @@ const dL = () => {
28996
28988
  {
28997
28989
  open: i,
28998
28990
  anchorEl: n,
28999
- onClose: d,
28991
+ onClose: u,
29000
28992
  anchorOrigin: {
29001
28993
  vertical: "bottom",
29002
28994
  horizontal: "center"
@@ -29067,11 +29059,7 @@ const dL = () => {
29067
29059
  sessionStorage.clear();
29068
29060
  } catch {
29069
29061
  }
29070
- try {
29071
- window.location.href = c();
29072
- } catch {
29073
- }
29074
- l().catch(() => {
29062
+ window.location.reload(), l().catch(() => {
29075
29063
  }), t && t().catch(() => {
29076
29064
  });
29077
29065
  },