@campxdev/shared 3.0.5 → 3.0.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": "3.0.5",
3
+ "version": "3.0.7",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -11,15 +11,18 @@ import GlobalNetworkLoadingIndicator from '../components/ErrorBoundary/GlobalNet
11
11
  import ErrorModalProvider from '../components/ErrorModalWrapper/ErrorModalWrapper'
12
12
  import RootModal from './RootModal'
13
13
 
14
- export const isDevelopment = window.location.hostname.includes('localhost')
14
+ const isDevelopment = process.env.NODE_ENV == 'development'
15
15
 
16
- export const campxTenantKey = window.location.hostname.split('.')[0]
17
-
18
- export const urlTenantKey = window.location.hostname.split('.')[0]
19
-
20
- export const instituitionKey = window.location.pathname.split('/')[1]
21
-
22
- export const workspace = window.location.pathname.split('/')[2]
16
+ export const campxTenantKey = isDevelopment
17
+ ? Cookies.get('campx_tenant')
18
+ : window.location.hostname.split('.')[0]
19
+ export const urlTenantKey = isDevelopment
20
+ ? Cookies.get('campx_tenant')
21
+ : window.location.hostname.split('.')[0]
22
+ export const instituitionKey =
23
+ window.location.pathname.split('/')[1] != ''
24
+ ? window.location.pathname.split('/')[1]
25
+ : Cookies.get('campx_institution')
23
26
 
24
27
  export default function Providers({ children }: { children: ReactNode }) {
25
28
  var baseName = '/'