Skip to content

Commit

Permalink
update hooks to use prop conditional when fetching new output
Browse files Browse the repository at this point in the history
  • Loading branch information
bryzettler committed Oct 30, 2024
1 parent dcd9ec4 commit 1fcdff1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
12 changes: 6 additions & 6 deletions ios/HeliumWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.10.0;
MARKETING_VERSION = 2.10.1;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -1117,7 +1117,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.10.0;
MARKETING_VERSION = 2.10.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -1303,7 +1303,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.10.0;
MARKETING_VERSION = 2.10.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
Expand Down Expand Up @@ -1348,7 +1348,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.10.0;
MARKETING_VERSION = 2.10.1;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
PRODUCT_BUNDLE_IDENTIFIER = com.helium.wallet.app.OneSignalNotificationServiceExtension;
Expand Down Expand Up @@ -1396,7 +1396,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.10.0;
MARKETING_VERSION = 2.10.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
Expand Down Expand Up @@ -1445,7 +1445,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.10.0;
MARKETING_VERSION = 2.10.1;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
PRODUCT_BUNDLE_IDENTIFIER = com.helium.wallet.app.HeliumWalletWidget;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "helium-wallet",
"version": "2.10.0",
"version": "2.10.1",
"private": true,
"scripts": {
"postinstall": "patch-package && ./node_modules/.bin/rn-nodeify --hack --install && npx jetify",
Expand Down
23 changes: 17 additions & 6 deletions src/features/swaps/SwapScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -478,32 +478,43 @@ const SwapScreen = () => {
],
)

useEffect(() => {
setRecipient('')
setRecipientOpen(false)
setOutputAmount(0)
}, [
inputMint,
inputAmount,
outputMint,
setRecipient,
setRecipientOpen,
setOutputAmount,
])

useEffect(() => {
// if changing outputMint ensure we get new routes
;(async () => {
if (
!isDevnet &&
inputMintAcc &&
outputMintAcc &&
inputMintAcc?.address === inputMint &&
outputMintAcc?.address === outputMint &&
typeof inputAmount !== 'undefined' &&
inputAmount > 0 &&
!outputMintAcc?.address.equals(DC_MINT)
) {
setRecipient('')
setRecipientOpen(false)
await getOutputAmount({
balance: toBN(inputAmount || 0, inputMintAcc.decimals),
})
}
})()
}, [
getOutputAmount,
inputMint,
inputAmount,
inputMintAcc,
outputMint,
outputMintAcc,
isDevnet,
setRecipient,
setRecipientOpen,
])

const getInputAmount = useCallback(
Expand Down

0 comments on commit 1fcdff1

Please sign in to comment.