Skip to content

Commit

Permalink
Fix bridging on testnets and adjust seedless expired token check (#1350)
Browse files Browse the repository at this point in the history
  • Loading branch information
atn4z7 authored Jun 6, 2024
1 parent 7138952 commit 43bc9ee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { selectBridgeAppConfig } from 'store/bridge'
import { useNetworks } from 'hooks/networks/useNetworks'
import { useInAppRequest } from 'hooks/useInAppRequest'
import BridgeService from 'services/bridge/BridgeService'
import { selectIsDeveloperMode } from 'store/settings/advanced/slice'

type TransferParams = {
amount: Big
Expand All @@ -34,6 +35,7 @@ export function useTransferAssetEVM(): {
const { networks } = useNetworks()
const activeAccount = useSelector(selectActiveAccount)
const config = useSelector(selectBridgeAppConfig)
const isDeveloperMode = useSelector(selectIsDeveloperMode)
const { currentBlockchain } = useBridgeSDK()
const { request } = useInAppRequest()

Expand Down Expand Up @@ -62,13 +64,20 @@ export function useTransferAssetEVM(): {
config,
activeAccount,
allNetworks: networks,
isTestnet: false,
isTestnet: isDeveloperMode,
onStatusChange,
onTxHashChange,
request
})
},
[currentBlockchain, config, activeAccount, networks, request]
[
currentBlockchain,
config,
activeAccount,
isDeveloperMode,
networks,
request
]
)

return {
Expand Down
2 changes: 1 addition & 1 deletion packages/core-mobile/app/seedless/store/listeners.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('seedless - listeners', () => {
store.dispatch(onRehydrationComplete())
GlobalEvents.triggerErrorEvent({
status: 403,
isUserMfaError: () => false
isSessionExpiredError: () => true
} as ErrorEvent)
expect(mockNavigate).toHaveBeenCalledWith({
name: 'Root.RefreshToken',
Expand Down
2 changes: 1 addition & 1 deletion packages/core-mobile/app/seedless/store/listeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const registerSeedlessErrorHandler = async (
Logger.error('seedless error', JSON.stringify({ ...e, url: '' }))

// handle re-auth for expired token
if (e.status === 403 && !e.isUserMfaError()) {
if (e.isSessionExpiredError()) {
dispatch(onTokenExpired)
}
}
Expand Down

0 comments on commit 43bc9ee

Please sign in to comment.