Skip to content

Commit

Permalink
add error boundary for orders
Browse files Browse the repository at this point in the history
  • Loading branch information
SorinC6 committed Nov 9, 2023
1 parent 58929df commit 29b79b7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const AmountInput = ({onChange, value, editable, inputRef}: AmountInputProps) =>
placeholder="0"
onChangeText={onChange}
allowFontScaling
selectionColor={COLORS.TRANSPARENT_BLACK}
selectionColor="#242838"
style={styles.amountInput}
underlineColorAndroid="transparent"
editable={editable}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {ButtonGroup} from '../../../common/ButtonGroup/ButtonGroup'
import {useStrings} from '../../../common/strings'
import {CompletedOrders, CompletedOrdersSkeleton} from './CompletedOrders'
import {OpenOrders, OpenOrdersSkeleton} from './OpenOrders'
import {ErrorBoundary} from 'react-error-boundary'
import {ServiceUnavailable} from '../../../common/ServiceUnavailable/ServiceUnavailable'

export const ListOrders = () => {
const {navigateToTxHistory} = useWalletNavigation()
Expand Down Expand Up @@ -36,11 +38,19 @@ export const ListOrders = () => {

{orderStatusIndex === 0 ? (
<Boundary loading={{fallback: <OpenOrdersSkeleton />}}>
<OpenOrders />
<ErrorBoundary
fallbackRender={({resetErrorBoundary}) => <ServiceUnavailable resetErrorBoundary={resetErrorBoundary} />}
>
<OpenOrders />
</ErrorBoundary>
</Boundary>
) : (
<Boundary loading={{fallback: <CompletedOrdersSkeleton />}}>
<CompletedOrders />
<ErrorBoundary
fallbackRender={({resetErrorBoundary}) => <ServiceUnavailable resetErrorBoundary={resetErrorBoundary} />}
>
<CompletedOrders />
</ErrorBoundary>
</Boundary>
)}
</View>
Expand Down

0 comments on commit 29b79b7

Please sign in to comment.