@@ -7,11 +7,11 @@ import LabeledInput from '../../components/LabeledInput';
7
7
import SafeAreaInset from '../../components/SafeAreaInset' ;
8
8
import Button from '../../components/buttons/Button' ;
9
9
import { useAppDispatch , useAppSelector } from '../../hooks/redux' ;
10
+ import { useSheetRef } from '../../navigation/bottom-sheet/SheetRefsProvider' ;
10
11
import { ProfileLinkScreenProps } from '../../navigation/types' ;
11
12
import { profileLinkSelector } from '../../store/reselect/ui' ;
12
13
import { addLink } from '../../store/slices/slashtags' ;
13
14
import { updateProfileLink } from '../../store/slices/ui' ;
14
- import { closeSheet } from '../../store/utils/ui' ;
15
15
import { BodyS , BodySB } from '../../styles/text' ;
16
16
import { suggestions } from './ProfileLinkSuggestions' ;
17
17
@@ -20,10 +20,11 @@ const ProfileLink = ({
20
20
} : ProfileLinkScreenProps < 'ProfileLink' > ) : ReactElement => {
21
21
const { t } = useTranslation ( 'slashtags' ) ;
22
22
const dispatch = useAppDispatch ( ) ;
23
+ const sheetRef = useSheetRef ( 'profileAddDataForm' ) ;
23
24
const form = useAppSelector ( profileLinkSelector ) ;
24
25
25
- const onSave = async ( ) : Promise < void > => {
26
- closeSheet ( 'profileAddDataForm' ) ;
26
+ const onSave = ( ) : void => {
27
+ sheetRef . current ?. close ( ) ;
27
28
dispatch ( addLink ( form ) ) ;
28
29
dispatch ( updateProfileLink ( { title : '' , url : '' } ) ) ;
29
30
} ;
0 commit comments