Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

use `onClose` instead of `onChange` for close callback (#3116)

authored by

Hailey and committed by
GitHub
57854e6f 20b88f43

+16 -22
+16 -22
src/components/Dialog/index.tsx
··· 119 119 [open, close], 120 120 ) 121 121 122 - const onChange = React.useCallback( 123 - (index: number) => { 124 - if (index === -1) { 125 - Keyboard.dismiss() 126 - try { 127 - closeCallback.current?.() 128 - } catch (e: any) { 129 - logger.error(`Dialog closeCallback failed`, { 130 - message: e.message, 131 - }) 132 - } finally { 133 - closeCallback.current = undefined 134 - } 135 - 136 - setDialogIsOpen(control.id, false) 137 - onClose?.() 138 - setOpenIndex(-1) 139 - } 140 - }, 141 - [onClose, setOpenIndex, setDialogIsOpen, control.id], 142 - ) 122 + const onCloseInner = React.useCallback(() => { 123 + Keyboard.dismiss() 124 + try { 125 + closeCallback.current?.() 126 + } catch (e: any) { 127 + logger.error(`Dialog closeCallback failed`, { 128 + message: e.message, 129 + }) 130 + } finally { 131 + closeCallback.current = undefined 132 + } 133 + setDialogIsOpen(control.id, false) 134 + onClose?.() 135 + setOpenIndex(-1) 136 + }, [control.id, onClose, setDialogIsOpen]) 143 137 144 138 const context = React.useMemo(() => ({close}), [close]) 145 139 ··· 167 161 backdropComponent={Backdrop} 168 162 handleIndicatorStyle={{backgroundColor: t.palette.primary_500}} 169 163 handleStyle={{display: 'none'}} 170 - onChange={onChange}> 164 + onClose={onCloseInner}> 171 165 <Context.Provider value={context}> 172 166 <View 173 167 style={[