diff --git a/lib/ui/components/SimpleAttachment.tsx b/lib/ui/components/SimpleAttachment.tsx index 0e71733..973de99 100644 --- a/lib/ui/components/SimpleAttachment.tsx +++ b/lib/ui/components/SimpleAttachment.tsx @@ -1,16 +1,22 @@ import * as WebBrowser from 'expo-web-browser' +import { useState } from 'react' import { Pressable, View } from 'react-native' import { Icon, Text } from 'react-native-paper' export default function SimpleAttachment(props: Props) { + const [clicked, setClicked] = useState(false) return ( { - await WebBrowser.openBrowserAsync(props.link) + setClicked(true) + const browse = await WebBrowser.openBrowserAsync(props.link) + if (browse.type) { + setClicked(false) + } }} > - + {props.title}