File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import {
1515 StyleSheet ,
1616 Image ,
1717 ActivityIndicator ,
18+ Keyboard ,
1819} from 'react-native' ;
1920import ImageSourceSheet from '../bottomSheets/ImageSourceSheet' ;
2021import { useImageAttachment } from '../../hooks/useImageAttachment' ;
@@ -77,7 +78,7 @@ const ChatBar = ({
7778 imageSourceSheetRef,
7879 pickFromLibrary,
7980 pickFromCamera,
80- openSourceSheet : handleAttachImage ,
81+ openSourceSheet : openImageSourceSheet ,
8182 clearImage,
8283 } = useImageAttachment ( ) ;
8384
@@ -103,6 +104,12 @@ const ChatBar = ({
103104 }
104105 } ;
105106
107+ const handleAttachImage = useCallback ( ( ) => {
108+ Keyboard . dismiss ( ) ;
109+ loadSelectedModel ( ) ;
110+ openImageSourceSheet ( ) ;
111+ } , [ loadSelectedModel , openImageSourceSheet ] ) ;
112+
106113 const isVisionModel = model ?. vision === true ;
107114
108115 useEffect ( ( ) => {
Original file line number Diff line number Diff line change @@ -114,10 +114,12 @@ export default function ChatScreen({
114114 chat ?. enabledSources || phantomChat ?. enabledSources || [ ] ;
115115
116116 const handlePresentModelSheet = useCallback ( ( ) => {
117+ Keyboard . dismiss ( ) ;
117118 modelBottomSheetModalRef . current ?. present ( ) ;
118119 } , [ ] ) ;
119120
120121 const handlePresentSourceSheet = useCallback ( ( ) => {
122+ Keyboard . dismiss ( ) ;
121123 sourceBottomSheetModalRef . current ?. present ( ) ;
122124 } , [ ] ) ;
123125
You can’t perform that action at this time.
0 commit comments