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

add realtime typing #493

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ketteiteki
Copy link
Contributor

@ketteiteki ketteiteki commented Jun 26, 2023

Implements #491

Copy link
Member

@kolosovpetro kolosovpetro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, few minor comments and suggestions

Copy link
Member

@kolosovpetro kolosovpetro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider creating separate real time group for every chat, this group is responsible for "is typing ..." notification.

@@ -545,6 +588,22 @@ export class ChatsComponent implements OnInit {
}
}

onTypingHandler(event: KeyboardEvent) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const userData = this._tokensService.getTokens();
if (!userData) return;

if (event.key.match(/^[a-zA-Zа-яА-ЯёЁ0-9+\-[\]{}(),./'"]$/) || event.key === 'Backspace') {
Copy link
Member

@kolosovpetro kolosovpetro Jun 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this if (event.key.match(/^[a-zA-Zа-яА-ЯёЁ0-9+\-[\]{}(),./'"]$/) || event.key === 'Backspace') is redundant if we handle text input value changed event

@@ -545,6 +588,22 @@ export class ChatsComponent implements OnInit {
}
}

onTypingHandler(event: KeyboardEvent) {
const userData = this._tokensService.getTokens();
if (!userData) return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please throw some exception here so we know that tokens are null or empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants