Skip to content

Commit

Permalink
Fix infinite loading state when onboarding a hotspot with valid linke…
Browse files Browse the repository at this point in the history
…d transaction. (#540)

* Fix infinite loading state when onboarding a hotspot with valid linked transaction.

* Bump version to 2.4.2
  • Loading branch information
Matt Reetz authored Nov 15, 2023
1 parent 50ba269 commit 3061896
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
12 changes: 6 additions & 6 deletions ios/HeliumWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.4.1;
MARKETING_VERSION = 2.4.2;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -1035,7 +1035,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.4.1;
MARKETING_VERSION = 2.4.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -1203,7 +1203,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.4.1;
MARKETING_VERSION = 2.4.2;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
Expand Down Expand Up @@ -1248,7 +1248,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.4.1;
MARKETING_VERSION = 2.4.2;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
PRODUCT_BUNDLE_IDENTIFIER = com.helium.wallet.app.OneSignalNotificationServiceExtension;
Expand Down Expand Up @@ -1296,7 +1296,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.4.1;
MARKETING_VERSION = 2.4.2;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
Expand Down Expand Up @@ -1345,7 +1345,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.4.1;
MARKETING_VERSION = 2.4.2;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
PRODUCT_BUNDLE_IDENTIFIER = com.helium.wallet.app.HeliumWalletWidget;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "helium-wallet",
"version": "2.4.1",
"version": "2.4.2",
"private": true,
"scripts": {
"postinstall": "patch-package && ./node_modules/.bin/rn-nodeify --hack --install && npx jetify",
Expand Down Expand Up @@ -324,4 +324,4 @@
"vm": "vm-browserify",
"zlib": "browserify-zlib"
}
}
}
30 changes: 20 additions & 10 deletions src/features/txnDelegation/useSolTxns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,26 @@ const useSolTxns = (heliumAddress: string, solanaTransactions?: string) => {
return {}
}

const bs58Decoded = bs58.decode(
(last(instructions) as web3.PartiallyDecodedInstruction).data,
)
const decodedBs58Instruction = coder.decode(Buffer.from(bs58Decoded))
if (!decodedBs58Instruction) {
return {}
}
let gatewayAddress = ''
instructions.some((i) => {
try {
const bs58Decoded = bs58.decode(
(i as web3.PartiallyDecodedInstruction).data,
)

const decodedBs58Instruction = coder.decode(Buffer.from(bs58Decoded))
if (!decodedBs58Instruction) {
return false
}

const entityKey = get(decodedBs58Instruction, 'data.args.entityKey')
const entityKey = get(decodedBs58Instruction, 'data.args.entityKey')

const gatewayAddress = bs58.encode(entityKey)
gatewayAddress = bs58.encode(entityKey)
return !!gatewayAddress
} catch {
return false
}
})

const { location, elevation, gain } = get(
decodedInstruction,
Expand Down Expand Up @@ -365,8 +374,9 @@ const useSolTxns = (heliumAddress: string, solanaTransactions?: string) => {
)

useAsync(async () => {
if (!solanaTransactions || handledTxnStr.current === solanaTransactions)
if (!solanaTransactions || handledTxnStr.current === solanaTransactions) {
return
}

const txns = solanaTransactions
.split(',')
Expand Down

0 comments on commit 3061896

Please sign in to comment.