Skip to content

Commit bfb4307

Browse files
committed
fix: updates
1 parent e695488 commit bfb4307

File tree

6 files changed

+196
-389
lines changed

6 files changed

+196
-389
lines changed

example/app/(tabs)/AssetsScreens/get-asset-accounts.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import { useNavigation } from "@react-navigation/native";
55
import { useEffect, useRef, useState } from "react";
66
import { Alert, SectionList, StyleSheet, Text, View } from "react-native";
77
import {
8-
AssetAccount,
98
AssetAccountQuery,
10-
LinkedAccountStatusRef,
9+
GetAssetAccountsResponse,
1110
} from "react-native-candle";
1211
import { SafeAreaView } from "react-native-safe-area-context";
1312
import { useCandleClient } from "../../Context/candle-context";
@@ -20,15 +19,10 @@ export default function GetAssetAccountsScreen() {
2019
const candleClient = useCandleClient();
2120
const navigation = useNavigation<any>();
2221

23-
const [filters, setFilters] = useState<AssetAccountQuery>({
24-
assetKind: undefined,
25-
linkedAccountIDs: undefined,
26-
});
22+
const [filters, setFilters] = useState<AssetAccountQuery>({});
2723

28-
const [assetAccounts, setAssetAccounts] = useState<{
29-
assetAccounts: AssetAccount[];
30-
linkedAccounts: LinkedAccountStatusRef[];
31-
}>();
24+
const [assetAccounts, setAssetAccounts] =
25+
useState<GetAssetAccountsResponse>();
3226
const [isLoading, setIsLoading] = useState(true);
3327

3428
const fetchAssetAccounts = async (queryFilters: AssetAccountQuery) => {

example/app/(tabs)/LinkedAccountsScreens/get-linked-accounts.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ type GetLinkedAccountsRouteProp = RouteProp<
2828

2929
export default function GetLinkedAccountsScreen() {
3030
const route = useRoute<GetLinkedAccountsRouteProp>();
31-
const candleClient = useCandleClient();
32-
3331
const navigation = useNavigation<any>();
32+
const candleClient = useCandleClient();
3433

3534
const [isLoading, setIsLoading] = useState(false);
3635
const [linkedAccounts, setLinkedAccounts] = useState<LinkedAccountDetail[]>(
@@ -39,9 +38,10 @@ export default function GetLinkedAccountsScreen() {
3938

4039
useEffect(() => {
4140
if (linkedAccounts.length > 0) return;
41+
// Adds delay else the loading indicator doesn't show
4242
const timeoutId = setTimeout(() => {
4343
onRefresh();
44-
}, 1000);
44+
}, 300);
4545
return () => clearTimeout(timeoutId);
4646
}, []);
4747

0 commit comments

Comments
 (0)