add realtime typing#493
Conversation
kolosovpetro
left a comment
There was a problem hiding this comment.
Looks good, few minor comments and suggestions
kolosovpetro
left a comment
There was a problem hiding this comment.
Consider creating separate real time group for every chat, this group is responsible for "is typing ..." notification.
| } | ||
| } | ||
|
|
||
| onTypingHandler(event: KeyboardEvent) { |
There was a problem hiding this comment.
Bind this handler to message text input value changed, see example https://github.com/MangoInstantMessenger/MangoMessengerAPI/blob/develop/MangoAPI.Client/src/app/components/contacts/contacts.component.html#L38
| const userData = this._tokensService.getTokens(); | ||
| if (!userData) return; | ||
|
|
||
| if (event.key.match(/^[a-zA-Zа-яА-ЯёЁ0-9+\-[\]{}(),./'"]$/) || event.key === 'Backspace') { |
There was a problem hiding this comment.
this if (event.key.match(/^[a-zA-Zа-яА-ЯёЁ0-9+\-[\]{}(),./'"]$/) || event.key === 'Backspace') is redundant if we handle text input value changed event
|
|
||
| onTypingHandler(event: KeyboardEvent) { | ||
| const userData = this._tokensService.getTokens(); | ||
| if (!userData) return; |
There was a problem hiding this comment.
Please throw some exception here so we know that tokens are null or empty
Implements #491