@opexa/portal-components 0.0.1112 → 0.0.1114
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.
|
@@ -18,6 +18,8 @@ export function DigitainContainer(props) {
|
|
|
18
18
|
paramsRef.current = props.params;
|
|
19
19
|
const bootedRef = useRef(false);
|
|
20
20
|
const waitingForScriptRef = useRef(true);
|
|
21
|
+
const hasRefreshedRef = useRef(false);
|
|
22
|
+
const failTimeoutRef = useRef(undefined);
|
|
21
23
|
const [isBooting, setIsBooting] = useState(true);
|
|
22
24
|
const [progress, setProgress] = useState(0);
|
|
23
25
|
const [stepIndex, setStepIndex] = useState(0);
|
|
@@ -53,7 +55,8 @@ export function DigitainContainer(props) {
|
|
|
53
55
|
return true;
|
|
54
56
|
}, []);
|
|
55
57
|
useEffect(() => {
|
|
56
|
-
if (session.data?.status === 'authenticated') {
|
|
58
|
+
if (session.data?.status === 'authenticated' && !hasRefreshedRef.current) {
|
|
59
|
+
hasRefreshedRef.current = true;
|
|
57
60
|
router.refresh();
|
|
58
61
|
}
|
|
59
62
|
}, [session.data?.status, router]);
|
|
@@ -97,12 +100,17 @@ export function DigitainContainer(props) {
|
|
|
97
100
|
}, [runBoot]);
|
|
98
101
|
// Fails if the script never becomes bootable
|
|
99
102
|
useEffect(() => {
|
|
100
|
-
|
|
103
|
+
if (failTimeoutRef.current)
|
|
104
|
+
clearTimeout(failTimeoutRef.current);
|
|
105
|
+
failTimeoutRef.current = setTimeout(() => {
|
|
101
106
|
if (bootedRef.current)
|
|
102
107
|
return;
|
|
103
108
|
failLoad('Sportsbook failed to load in time. Please refresh or try again later.');
|
|
104
109
|
}, SCRIPT_FAIL_TIMEOUT_MS);
|
|
105
|
-
return () =>
|
|
110
|
+
return () => {
|
|
111
|
+
if (failTimeoutRef.current)
|
|
112
|
+
clearTimeout(failTimeoutRef.current);
|
|
113
|
+
};
|
|
106
114
|
}, [failLoad]);
|
|
107
115
|
return (_jsxs("div", { className: "w-full min-h-[calc(100dvh-4rem)]", children: [isBooting ? (_jsx(DigitainLoadingView, { fallbackBackgroundImage: props.fallbackBackgroundImage, loadingProgress: progress, loadingActiveStepIndex: stepIndex })) : null, _jsx("div", { id: "digitain-container", className: isBooting ? 'hidden' : 'w-full min-h-[calc(100dvh-4rem)]' })] }));
|
|
108
116
|
}
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
4
|
import { Progress } from '../../ui/Progress/index.js';
|
|
5
|
-
const STEPS = [
|
|
5
|
+
const STEPS = [
|
|
6
|
+
'Connecting to server',
|
|
7
|
+
'Setting up your session',
|
|
8
|
+
'Launching Sportsbook',
|
|
9
|
+
];
|
|
6
10
|
/** Centered copy + progress only—no card shell; meant to sit on a dark overlay. */
|
|
7
11
|
export function DigitainLoadingPanel({ progress, activeStepIndex, }) {
|
|
8
12
|
const clamped = Math.min(100, Math.max(0, progress));
|
|
@@ -6,5 +6,5 @@ import { DigitainLoadingPanel } from './DigitainLoadingPanel.js';
|
|
|
6
6
|
* Dimmed full-area overlay (below the app header) with optional hero image behind it.
|
|
7
7
|
*/
|
|
8
8
|
export function DigitainLoadingView(props) {
|
|
9
|
-
return (_jsxs("div", { className: "w-full min-h-[calc(100dvh-4rem)]", children: [props.fallbackBackgroundImage ? (_jsx("div", { className: "relative min-h-[calc(100dvh-4rem)] w-full overflow-hidden rounded-xl", children: _jsx(Image, { src: props.fallbackBackgroundImage, alt: "", fill: true, className: "object-cover", sizes: "100vw" }) })) : null, _jsx("div", { className: "fixed inset-x-0 top-16 bottom-0 z-[1000] flex min-h-0 items-center justify-center overflow-y-auto overscroll-contain bg-black/65 px-4 py-6 backdrop-blur-md sm:px-10 sm:py-10", children: _jsx("div", { className: "my-auto w-full max-w-
|
|
9
|
+
return (_jsxs("div", { className: "w-full min-h-[calc(100dvh-4rem)]", children: [props.fallbackBackgroundImage ? (_jsx("div", { className: "relative min-h-[calc(100dvh-4rem)] w-full overflow-hidden rounded-xl", children: _jsx(Image, { src: props.fallbackBackgroundImage, alt: "", fill: true, className: "object-cover", sizes: "100vw" }) })) : null, _jsx("div", { className: "fixed inset-x-0 top-16 bottom-0 z-[1000] flex min-h-0 items-center justify-center overflow-y-auto overscroll-contain bg-black/65 px-4 py-6 backdrop-blur-md sm:px-10 sm:py-10", children: _jsx("div", { className: "my-auto w-full max-w-[22rem] py-2 pb-[max(1.5rem,env(safe-area-inset-bottom))]", children: _jsx(DigitainLoadingPanel, { progress: props.loadingProgress, activeStepIndex: props.loadingActiveStepIndex }) }) })] }));
|
|
10
10
|
}
|