-
Notifications
You must be signed in to change notification settings - Fork 0
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
Chat 229 typing event #75
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Override | ||
public void getTypingEvent(Boolean isTyping, String email) { | ||
log.info("Start getTypingEvent isTyping={}, email={}", isTyping, email); | ||
contactEventService.updateTypingEvent(email, isTyping); | ||
|
||
Integer topicId = contactEventService.getAllByEmail(email).stream() | ||
.filter(e -> e.getEventType().equals(EventType.SUBSCRIBED)) | ||
.findFirst() | ||
.orElseThrow() | ||
.getTopicId(); | ||
|
||
chatNotificationService.updateNotificationForAllWhoSubscribedToTopic(topicId); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
трохи збиває з пантелику назва методу getTypingEvent. метод нічого не повертає хоча в назві get. навпаки він оновлює isTyping і робить оповіщення клієнтів.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Згоден) Давай виправлю на updateTypingEvent або запропонуй іншу назву.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updateTypingEvent буде норм
document.addEventListener('keydown', function() { | ||
if (!isTyping) { | ||
isTyping = true; | ||
sendTyping(isTyping); | ||
} | ||
|
||
clearTimeout(typingTimer); | ||
typingTimer = setTimeout(function() { | ||
isTyping = false; | ||
sendTyping(isTyping); | ||
}, 2000); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
що буде якщо клієнт буде друкувати та зникне зв'язок? по суті на бекенді залишиться статус що він друкує. або я не знайшов на бекенді де змінюється typingEvent без команди з фронта.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не перевіряв цей кейс. Гарне зауваження. Виправлю)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
може це зробити іншою таскою щоб не затримувати фронт?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ок
No description provided.