Skip to content

Commit

Permalink
fix: allow user_id in keystroke and stopTyping function (#1221)
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalnarkhede authored Feb 5, 2024
1 parent 7bb64a8 commit c81586b
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit c81586b

Please sign in to comment.