@campxdev/shared 1.8.49-alpha.6 → 1.8.49-alpha.7

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "1.8.49-alpha.6",
3
+ "version": "1.8.49-alpha.7",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -96,6 +96,11 @@ function handleInstitutions(institutions) {
96
96
  `${window.location.origin}/${urlTenantKey}/${institutions[0]?.code}`,
97
97
  )
98
98
  }
99
+ if (insititutionKey !== institutions[0]?.code) {
100
+ window.location.replace(
101
+ `${window.location.origin}/${urlTenantKey}/${institutions[0]?.code}`,
102
+ )
103
+ }
99
104
  InsititutionsStore.update((s) => {
100
105
  s.current = institutions[0]
101
106
  s.institutions = institutions
@@ -111,6 +116,18 @@ function handleInstitutions(institutions) {
111
116
  },
112
117
  })
113
118
  }
119
+ if (
120
+ insititutionKey &&
121
+ !institutions?.find((item) => item.code === insititutionKey)
122
+ ) {
123
+ openRootModal({
124
+ key: 'institutions',
125
+ dialogProps: {
126
+ disableEscapeKeyDown: true,
127
+ onClose: () => {},
128
+ },
129
+ })
130
+ }
114
131
  InsititutionsStore.update((s) => {
115
132
  s.institutions = institutions
116
133
  s.current = institutions.find((item) => item.code === insititutionKey)