@@ -12,7 +12,7 @@ import { useHandler } from '../../hooks/useHandler'
1212import { lstrings } from '../../locales/strings'
1313import { config } from '../../theme/appConfig'
1414import { useDispatch } from '../../types/reactRedux'
15- import { Airship } from '../services/AirshipInstance'
15+ import { Airship , showError } from '../services/AirshipInstance'
1616import { type Theme , useTheme } from '../services/ThemeContext'
1717import { SelectableRow } from '../themed/SelectableRow'
1818import { EdgeModal } from './EdgeModal'
@@ -55,42 +55,51 @@ export const TransferModal = ({
5555 Airship . clear ( )
5656 } )
5757
58- const handleSend = useHandler ( async ( ) => {
59- const result = await Airship . show < WalletListResult > ( bridge => (
58+ const handleSend = useHandler ( ( ) => {
59+ Airship . show < WalletListResult > ( bridge => (
6060 < WalletListModal
6161 bridge = { bridge }
6262 headerTitle = { lstrings . select_wallet_to_send_from }
6363 navigation = { navigation }
6464 />
6565 ) )
66- if ( result ?. type === 'wallet' ) {
67- const { walletId, tokenId } = result
68- navigation . push ( 'send2' , {
69- walletId,
70- tokenId,
71- hiddenFeaturesMap : { scamWarning : false }
66+ . then ( result => {
67+ if ( result ?. type === 'wallet' ) {
68+ const { walletId, tokenId } = result
69+ navigation . push ( 'send2' , {
70+ walletId,
71+ tokenId,
72+ hiddenFeaturesMap : { scamWarning : false }
73+ } )
74+ }
75+ Airship . clear ( )
76+ } )
77+ . catch ( ( error : unknown ) => {
78+ showError ( error )
7279 } )
73- }
74- Airship . clear ( )
7580 } )
7681
77- const handleReceive = useHandler ( async ( ) => {
82+ const handleReceive = useHandler ( ( ) => {
7883 Airship . clear ( )
7984
80- const result = await Airship . show < WalletListResult > ( bridge => (
85+ Airship . show < WalletListResult > ( bridge => (
8186 < WalletListModal
8287 bridge = { bridge }
8388 headerTitle = { lstrings . select_receive_asset }
8489 navigation = { navigation }
8590 showCreateWallet
8691 />
8792 ) )
88-
89- if ( result ?. type === 'wallet' ) {
90- const { walletId, tokenId } = result
91- await dispatch ( selectWalletToken ( { navigation, walletId, tokenId } ) )
92- navigation . navigate ( 'request' , { tokenId, walletId } )
93- }
93+ . then ( async result => {
94+ if ( result ?. type === 'wallet' ) {
95+ const { walletId, tokenId } = result
96+ await dispatch ( selectWalletToken ( { navigation, walletId, tokenId } ) )
97+ navigation . navigate ( 'request' , { tokenId, walletId } )
98+ }
99+ } )
100+ . catch ( ( error : unknown ) => {
101+ showError ( error )
102+ } )
94103 } )
95104
96105 const handleCancel = useHandler ( ( ) => {
0 commit comments