@opexa/portal-components 0.0.471 → 0.0.473

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,18 +1,13 @@
1
1
  import { useCallback, useEffect, useState } from 'react';
2
2
  const mayaSessIdKey = 'mayaSessionId';
3
3
  export function useMayaAuth() {
4
- const [onMaya, setOnMayaState] = useState(() => {
5
- if (typeof window !== 'undefined') {
6
- return !!localStorage.getItem(mayaSessIdKey);
7
- }
8
- return false;
9
- });
4
+ const [onMaya, setOnMayaState] = useState(false);
10
5
  const setOnMaya = useCallback((value) => {
11
6
  setOnMayaState(value);
12
7
  }, []);
13
8
  useEffect(() => {
14
- if (typeof window === 'undefined')
15
- return;
9
+ const initialValue = !!localStorage.getItem(mayaSessIdKey);
10
+ setOnMayaState(initialValue);
16
11
  const handleStorageChange = () => {
17
12
  setOnMayaState(!!localStorage.getItem(mayaSessIdKey));
18
13
  };
@@ -27,7 +27,7 @@ export function Maya({ logo, responsibleGamingLogo, pagcorLogo, banner, classNam
27
27
  : (className ?? {});
28
28
  const init = async () => {
29
29
  setProgress(25);
30
- if (session.data) {
30
+ if (session.data?.status === 'authenticated') {
31
31
  if (mayaSessionId) {
32
32
  if (localStorage.getItem(mayaSessIdKey) === mayaSessionId) {
33
33
  setProgress(100);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.471",
3
+ "version": "0.0.473",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",