Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow user_id in keystroke and stopTyping function #1221

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ export class Channel<StreamChatGenerics extends ExtendableGenerics = DefaultGene
* @see {@link https://getstream.io/chat/docs/typing_indicators/?language=js|Docs}
* @param {string} [parent_id] set this field to `message.id` to indicate that typing event is happening in a thread
*/
async keystroke(parent_id?: string) {
async keystroke(parent_id?: string, options?: { user_id: string }) {
if (!this.getConfig()?.typing_events) {
return;
}
Expand All @@ -655,6 +655,7 @@ export class Channel<StreamChatGenerics extends ExtendableGenerics = DefaultGene
await this.sendEvent({
type: 'typing.start',
parent_id,
...(options || {}),
} as Event<StreamChatGenerics>);
}
}
Expand All @@ -664,7 +665,7 @@ export class Channel<StreamChatGenerics extends ExtendableGenerics = DefaultGene
* @see {@link https://getstream.io/chat/docs/typing_indicators/?language=js|Docs}
* @param {string} [parent_id] set this field to `message.id` to indicate that typing event is happening in a thread
*/
async stopTyping(parent_id?: string) {
async stopTyping(parent_id?: string, options?: { user_id: string }) {
if (!this.getConfig()?.typing_events) {
return;
}
Expand All @@ -673,6 +674,7 @@ export class Channel<StreamChatGenerics extends ExtendableGenerics = DefaultGene
await this.sendEvent({
type: 'typing.stop',
parent_id,
...(options || {}),
} as Event<StreamChatGenerics>);
}

Expand Down
Loading