display error animation on failure on loading screen (#532)

* display error animation on failure on loading screen

* remove log

---------

Co-authored-by: Justin Hernandez <transphorm@gmail.com>
This commit is contained in:
turnoffthiscomputer
2025-04-25 09:25:44 -04:00
committed by GitHub
parent fdfc0534fb
commit f5e45af0cf
2 changed files with 6 additions and 4 deletions

View File

@@ -1,5 +1,4 @@
import { StaticScreenProps } from '@react-navigation/native';
import { useIsFocused } from '@react-navigation/native';
import { StaticScreenProps, useIsFocused } from '@react-navigation/native';
import LottieView from 'lottie-react-native';
import React, { useEffect, useState } from 'react';
import { StyleSheet, Text, View } from 'react-native';
@@ -24,7 +23,7 @@ const LoadingScreen: React.FC<LoadingScreenProps> = ({}) => {
if (currentState === 'completed') {
setAnimationSource(successAnimation);
} else if (currentState === 'error') {
} else if (currentState === 'error' || currentState === 'failure') {
setAnimationSource(failAnimation);
} else {
setAnimationSource(miscAnimation);

View File

@@ -168,7 +168,10 @@ export const useProvingStore = create<ProvingState>((set, get) => {
if (state.value === 'post_proving') {
get().postProving();
}
if (get().circuitType !== 'disclose' && state.value === 'error') {
if (
get().circuitType !== 'disclose' &&
(state.value === 'error' || state.value === 'failure')
) {
setTimeout(() => {
if (navigationRef.isReady()) {
navigationRef.navigate('Launch');