Skip to content

Commit 31f1143

Browse files
committed
fix: additional checks
1 parent 139d3b5 commit 31f1143

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

ui/pages/onboarding-flow/creation-successful/wallet-ready-animation.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default function WalletReadyAnimation() {
5656

5757
// Trigger the animation start when rive is loaded
5858
useEffect(() => {
59-
if (rive && isWasmReady && !bufferLoading) {
59+
if (rive && isWasmReady && !bufferLoading && buffer) {
6060
console.log('rive is loaded', rive);
6161
const inputs = rive.stateMachineInputs('OnboardingLoader');
6262
if (inputs) {
@@ -76,11 +76,13 @@ export default function WalletReadyAnimation() {
7676
rive.play();
7777
}
7878
}
79-
}, [rive, theme, isWasmReady, bufferLoading]);
79+
}, [rive, theme, isWasmReady, bufferLoading, buffer]);
8080

81-
// Don't render Rive component until WASM is ready to avoid "source file required" error
81+
// Don't render Rive component until WASM and buffer are ready to avoid errors
8282
if (
8383
!isWasmReady ||
84+
bufferLoading ||
85+
!buffer ||
8486
status === 'loading' ||
8587
isTestEnvironment ||
8688
status === 'failed'

ui/pages/onboarding-flow/welcome/fox-appear-animation.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default function FoxAppearAnimation({
6666

6767
// Trigger the animation start when rive is loaded and WASM is ready
6868
useEffect(() => {
69-
if (rive && isWasmReady && !bufferLoading) {
69+
if (rive && isWasmReady && !bufferLoading && buffer) {
7070
// Get the state machine inputs
7171
const inputs = rive.stateMachineInputs('FoxRaiseUp');
7272

@@ -100,11 +100,13 @@ export default function FoxAppearAnimation({
100100
rive.play();
101101
}
102102
}
103-
}, [rive, isLoader, isWasmReady, skipTransition, bufferLoading]);
103+
}, [rive, isLoader, isWasmReady, skipTransition, bufferLoading, buffer]);
104104

105105
// Don't render Rive component until ready or if loading/failed
106106
if (
107107
!isWasmReady ||
108+
bufferLoading ||
109+
!buffer ||
108110
status === 'loading' ||
109111
status === 'failed' ||
110112
isTestEnvironment

ui/pages/onboarding-flow/welcome/metamask-wordmark-animation.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export default function MetamaskWordMarkAnimation({
9090

9191
// Trigger the animation start when rive is loaded and WASM is ready
9292
useEffect(() => {
93-
if (rive && isWasmReady && !bufferLoading) {
93+
if (rive && isWasmReady && !bufferLoading && buffer) {
9494
// Get the state machine inputs
9595
const inputs = rive.stateMachineInputs('WordmarkBuildUp');
9696

@@ -124,11 +124,13 @@ export default function MetamaskWordMarkAnimation({
124124
clearTimeout(animationTimeoutRef.current);
125125
}
126126
};
127-
}, [rive, theme, isWasmReady, skipTransition, bufferLoading]);
127+
}, [rive, theme, isWasmReady, skipTransition, bufferLoading, buffer]);
128128

129129
// Don't render Rive component until ready or if loading/failed
130130
if (
131131
!isWasmReady ||
132+
bufferLoading ||
133+
!buffer ||
132134
isTestEnvironment ||
133135
status === 'loading' ||
134136
status === 'failed'

0 commit comments

Comments
 (0)