Skip to content

Commit

Permalink
remove delay
Browse files Browse the repository at this point in the history
  • Loading branch information
marxeille committed Jan 31, 2024
1 parent a8c5107 commit a538b7d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 22 deletions.
2 changes: 0 additions & 2 deletions packages/mobile/src/navigations/main-tab-navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { observer } from 'mobx-react-lite';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import imagesGlobal from '@src/assets/images';
import { BlurView } from '@react-native-community/blur';
import { delay } from '@owallet/common';
const Tab = createBottomTabNavigator();
export const MainTabNavigation: FC = observer(() => {
const { chainStore, appInitStore } = useStore();
Expand All @@ -28,7 +27,6 @@ export const MainTabNavigation: FC = observer(() => {
}, [visibleTabBar]);

const waitToLoad = async () => {
await delay(800);
setLoading(false);
};

Expand Down
1 change: 0 additions & 1 deletion packages/mobile/src/screens/home/account-box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export const AccountBox: FunctionComponent<{
};

const waitToLoad = async () => {
await delay(800);
setLoading(false);
};

Expand Down
1 change: 0 additions & 1 deletion packages/mobile/src/screens/home/buy-fiat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const BuyFiat = observer(() => {
let accounts = {};

const delayedFunction = async () => {
await delay(800);
Object.keys(ChainIdEnum).map(key => {
if (KADOChainNameEnum[ChainIdEnum[key]]) {
let defaultAddress = accountStore.getAccount(ChainIdEnum[key]).bech32Address;
Expand Down
1 change: 0 additions & 1 deletion packages/mobile/src/screens/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ export const HomeScreen: FunctionComponent = observer(props => {
const { data: prices } = useCoinGeckoPrices();

const updatePrices = async () => {
await delay(1000);
appInitStore.updatePrices(prices);
};

Expand Down
32 changes: 19 additions & 13 deletions packages/mobile/src/screens/home/tokens-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,19 +258,25 @@ export const TokensCard: FunctionComponent<{
</View>
{index === 0 ? (
<CardBody>
<OWFlatList
containerSkeletonStyle={{
flexDirection: 'row'
}}
contentContainerStyle={{ marginBottom: -70 }}
data={chainStore.current.chainId === ChainIdEnum.Oasis ? [{ chainId: ChainIdEnum.Oasis }] : tokens}
renderItem={renderToken}
keyExtractor={_keyExtract}
SkeletonComponent={<SkeletonNft />}
loading={isLoading}
showsHorizontalScrollIndicator={false}
ListEmptyComponent={<OWEmpty />}
/>
{tokens?.length > 0 ? (
tokens.slice(0, 3).map((token, index) => {
const priceBalance = priceStore.calculatePrice(token.balance);
return (
<TokenItem
key={index?.toString()}
chainInfo={{
stakeCurrency: chainStore.current.stakeCurrency,
networkType: chainStore.current.networkType,
chainId: chainStore.current.chainId
}}
balance={token.balance}
priceBalance={priceBalance}
/>
);
})
) : (
<OWEmpty />
)}
</CardBody>
) : (
<CardBody
Expand Down
8 changes: 4 additions & 4 deletions packages/mobile/src/screens/universal-swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ export const UniversalSwapScreen: FunctionComponent = observer(() => {
const { colors } = useTheme();
const { data: prices } = useCoinGeckoPrices();

useEffect(() => {
appInitStore.updatePrices(prices);
}, [prices]);
// useEffect(() => {
// appInitStore.updatePrices(prices);
// }, [prices]);

const chainInfo = chainStore.getChain(ChainIdEnum.Oraichain);

Expand Down Expand Up @@ -263,7 +263,7 @@ export const UniversalSwapScreen: FunctionComponent = observer(() => {
};

const delayedFunction = useCallback(async () => {
await delay(1900);
await delay(100);
Object.keys(ChainIdEnum).map(key => {
let defaultAddress = accountStore.getAccount(ChainIdEnum[key]).bech32Address;
if (ChainIdEnum[key] === ChainIdEnum.TRON) {
Expand Down

0 comments on commit a538b7d

Please sign in to comment.