Skip to content

Commit

Permalink
wrap in InteractionManager
Browse files Browse the repository at this point in the history
  • Loading branch information
walmat committed May 24, 2024
1 parent 40efd30 commit d45fdff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Clipboard from '@react-native-clipboard/clipboard';
import lang from 'i18n-js';
import * as React from 'react';
import { PressableProps } from 'react-native';
import { InteractionManager, PressableProps } from 'react-native';
import Animated, { useAnimatedStyle, useDerivedValue, withSpring } from 'react-native-reanimated';
import { ButtonPressAnimation } from '@/components/animations';
import { CopyFloatingEmojis } from '@/components/floating-emojis';
Expand Down Expand Up @@ -180,7 +180,9 @@ function SwapButton() {

android && delayNext();
if (swapsV2Enabled) {
navigate(Routes.SWAP);
InteractionManager.runAfterInteractions(() => {
navigate(Routes.SWAP);
});
return;
}

Expand Down
6 changes: 2 additions & 4 deletions src/components/sheet/sheet-action-buttons/SwapActionButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ function SwapActionButton({ asset, color: givenColor, inputType, label, fromDisc
const chainId = ethereumUtils.getChainIdFromNetwork(asset.network);
const userAsset = userAssetsStore.getState().userAssets.get(`${asset.address}_${chainId}`);
const parsedAsset = parseSearchAsset({
assetWithPrice: undefined,
searchAsset: asset,
assetWithPrice: asset,
searchAsset: { ...asset, chainId },
userAsset,
});

console.log(parsedAsset);

if (inputType === assetInputTypes.in) {
setAsset({ type: SwapAssetType.inputAsset, asset: parsedAsset });
} else {
Expand Down

0 comments on commit d45fdff

Please sign in to comment.