File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
examples/TypeScriptMessaging Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ type ChannelScreenProps = {
104104const EmptyHeader = ( ) => < > </ > ;
105105
106106const ChannelScreen : React . FC < ChannelScreenProps > = ( { navigation } ) => {
107- const { channel, setThread } = useContext ( AppContext ) ;
107+ const { channel, setThread, thread } = useContext ( AppContext ) ;
108108 const headerHeight = useHeaderHeight ( ) ;
109109 const { overlay } = useOverlayContext ( ) ;
110110
@@ -120,7 +120,12 @@ const ChannelScreen: React.FC<ChannelScreenProps> = ({ navigation }) => {
120120
121121 return (
122122 < SafeAreaView >
123- < Channel audioRecordingEnabled = { true } channel = { channel } keyboardVerticalOffset = { headerHeight } >
123+ < Channel
124+ audioRecordingEnabled = { true }
125+ channel = { channel }
126+ keyboardVerticalOffset = { headerHeight }
127+ thread = { thread }
128+ >
124129 < View style = { { flex : 1 } } >
125130 < MessageList
126131 onThreadSelect = { ( selectedThread ) => {
Original file line number Diff line number Diff line change @@ -20,9 +20,16 @@ export const getDraftForChannels = async ({
2020
2121 const rows = await SqliteClient . executeSql . apply ( null , query ) ;
2222
23+ /**
24+ * Filter out drafts without a parent ID, as we will not show them in the channel.
25+ * The above `createSelectQuery` was not able to filter out drafts without a parent ID.
26+ * TODO: Fix the query to filter out drafts without a parent ID. This can be a bit faster.
27+ */
28+ const rowsWithoutParentID = rows . filter ( ( row ) => row . parentId === null ) ;
29+
2330 const cidVsDrafts : Record < string , DraftResponse > = { } ;
2431
25- for ( const row of rows ) {
32+ for ( const row of rowsWithoutParentID ) {
2633 const draftMessageQuery = createSelectQuery ( 'draftMessage' , [ '*' ] , {
2734 id : row . draftMessageId ,
2835 } ) ;
You can’t perform that action at this time.
0 commit comments