Skip to content

Commit

Permalink
Revert to closing the tab through alephium.org
Browse files Browse the repository at this point in the history
  • Loading branch information
nop33 committed Jan 8, 2025
1 parent a6bf1ef commit 4cfd87b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions apps/mobile-wallet/src/features/buy/BuyModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { AddressHash } from '@alephium/shared'
import { openBrowserAsync } from 'expo-web-browser'
import { Trans, useTranslation } from 'react-i18next'
import { Linking } from 'react-native'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
import styled, { useTheme } from 'styled-components/native'

Expand All @@ -10,7 +9,6 @@ import BottomButtons from '~/components/buttons/BottomButtons'
import Button from '~/components/buttons/Button'
import ScreenTitle from '~/components/layout/ScreenTitle'
import LinkToWeb from '~/components/text/LinkToWeb'
import { closeBanxaTabOnDeepLink } from '~/features/buy/buyUtils'
import useBanxaUrl from '~/features/buy/useBanxaUrl'
import BottomModal from '~/features/modals/BottomModal'
import { closeModal } from '~/features/modals/modalActions'
Expand All @@ -32,16 +30,12 @@ const BuyModal = withModal<BuyModalProps>(({ id, receiveAddressHash }) => {
const banxaUrl = useBanxaUrl(receiveAddressHash)

const openBanxaUrl = async () => {
Linking.addEventListener('url', closeBanxaTabOnDeepLink)

receiveAddress &&
(await openBrowserAsync(banxaUrl, {
openBrowserAsync(banxaUrl, {
createTask: false, // Android: the browser opens within our app without a new task in the task manager
toolbarColor: theme.bg.back1, // TODO: Wanted to use theme.bg.primary, but in light theme it's rgba and it looks black, not white
controlsColor: theme.global.accent // iOS: color of button texts
}))

Linking.removeAllListeners('url')
})

dispatch(closeModal({ id }))
}
Expand Down

0 comments on commit 4cfd87b

Please sign in to comment.