mirror of
https://github.com/selfxyz/self.git
synced 2026-01-10 07:08:10 -05:00
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:
committed by
GitHub
parent
fdfc0534fb
commit
f5e45af0cf
@@ -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);
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user