@@ -7,11 +7,11 @@ import LabeledInput from '../../components/LabeledInput';
77import SafeAreaInset from '../../components/SafeAreaInset' ;
88import Button from '../../components/buttons/Button' ;
99import { useAppDispatch , useAppSelector } from '../../hooks/redux' ;
10+ import { useSheetRef } from '../../navigation/bottom-sheet/SheetRefsProvider' ;
1011import { ProfileLinkScreenProps } from '../../navigation/types' ;
1112import { profileLinkSelector } from '../../store/reselect/ui' ;
1213import { addLink } from '../../store/slices/slashtags' ;
1314import { updateProfileLink } from '../../store/slices/ui' ;
14- import { closeSheet } from '../../store/utils/ui' ;
1515import { BodyS , BodySB } from '../../styles/text' ;
1616import { suggestions } from './ProfileLinkSuggestions' ;
1717
@@ -20,10 +20,11 @@ const ProfileLink = ({
2020} : ProfileLinkScreenProps < 'ProfileLink' > ) : ReactElement => {
2121 const { t } = useTranslation ( 'slashtags' ) ;
2222 const dispatch = useAppDispatch ( ) ;
23+ const sheetRef = useSheetRef ( 'profileAddDataForm' ) ;
2324 const form = useAppSelector ( profileLinkSelector ) ;
2425
25- const onSave = async ( ) : Promise < void > => {
26- closeSheet ( 'profileAddDataForm' ) ;
26+ const onSave = ( ) : void => {
27+ sheetRef . current ?. close ( ) ;
2728 dispatch ( addLink ( form ) ) ;
2829 dispatch ( updateProfileLink ( { title : '' , url : '' } ) ) ;
2930 } ;
0 commit comments