You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Possibility to open/get a thread by id (or by parent message id) that we can pass to the thread property of the Channel component.
In order to open a thread in an independent screen or from a (push) notification or from anywhere else.
The channel property on his side matches the api type so we can fetch it independently unlike the thread prop.
The only way to open a thread currently seems to be via the onThreadSelect prop of the MessageList.
Proposed solution
Acceptance Criteria
Open a thread from id (or parent message id).
As code example, I can get the channel but I'm not able to open the thread without passing the entire object obtained by a previous
export const ThreadViewerScreen: React.FC<NativeStackScreenProps<AppStackParamList, ScreenName.Thread>> = (props) => {
const { params } = props.route;
const { thread } = params; // I would need to pass only the id of the thread/message & fetch it/get it another way, in order for instance to open a thread from notification
const { channel } = useChatStoreValues(); // channel is a Channel from stream-chat which is ok, I can get it by id from the api
if (!channel) {
return null;
}
return (
<SafeAreaView>
<ChatLoadingAndErrorView>
<Channel
Input={CustomMessageInput}
channel={channel}
thread={thread}
allowThreadMessagesInChannel
threadList
>
<Thread />
</Channel>
</ChatLoadingAndErrorView>
</SafeAreaView>
);
};
The text was updated successfully, but these errors were encountered:
MatheoJaouen
changed the title
getThread or message as MessageType from id to feed the thread property of the Channel component.
Open a thread by id.
Jul 8, 2024
MatheoJaouen
changed the title
Open a thread by id.
Feature request: open a thread by id.
Jul 22, 2024
Motivation
Possibility to open/get a thread by id (or by parent message id) that we can pass to the
thread
property of theChannel
component.In order to open a thread in an independent screen or from a (push) notification or from anywhere else.
The
thread
property of the Channel component takes aMessageType
declared by the react-native api.While the api provide a different object Type for the
getMessage
orclient.getThread
(a MessageResponse if I recall correctly).https://getstream.io/chat/docs/react-native/threads/?language=javascript#get-thread-by-id
stream-chat-react-native/package/src/contexts/threadContext/ThreadContext.tsx
Line 21 in ea688c3
The channel property on his side matches the api type so we can fetch it independently unlike the thread prop.
The only way to open a thread currently seems to be via the
onThreadSelect
prop of theMessageList
.Proposed solution
Acceptance Criteria
Open a thread from id (or parent message id).
As code example, I can get the channel but I'm not able to open the thread without passing the entire object obtained by a previous
The text was updated successfully, but these errors were encountered: