Closed richardrigutins closed 8 months ago
Describe the bug On the User Info panel, when the user is typing or selecting a sticker, a series of when? strings keep getting added to the user status while the user keeps typing.
Only a single when? is displayed instead when the status changes to a different value (online, last seen recently).
To Reproduce Steps to reproduce the behavior:
- Open a chat with a user.
- Click on the user name or profile picture on the top bar to open the User Info panel.
- Have the user type a message for some seconds.
- The user status is displayed as typing, and multiple when? elements are progressively appended to the status.
Expected behavior Only a single when? element should be displayed.
Screenshots
Desktop (please complete the following information):
- OS: Windows
- Browser Chrome, Edge
- Version 122
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context The behavior could be caused by a conflict between the code block that appends the when element in
peerProfile.ts
:const when = i18n('StatusHiddenShow'); when.classList.add('show-when'); attachClickEvent(when, (e) => { cancelEvent(e); PopupElement.createPopup(PopupToggleReadDate, peerId, 'lastSeen'); }); this.subtitle.append(when);
and this check inside
setPeerStatus
inappImManager.ts
:const typingContainer = element.querySelector('.peer-typing-container') as HTMLElement; if(typingContainer && await this.getPeerTyping(peerId, typingContainer)) { // log('already have a status'); return; }
Because of this check, the subtitle element doesn't get replaced while the user is typing, but a when element keeps getting appended to it. When the user is not typing, the subtitle is replaced after every update, and only a single when element is displayed.
Ok
Good
Describe the bug On the User Info panel, when the user is typing or selecting a sticker, a series of when? strings keep getting added to the user status while the user keeps typing.
Only a single when? is displayed instead when the status changes to a different value (online, last seen recently).
To Reproduce Steps to reproduce the behavior:
Expected behavior Only a single when? element should be displayed.
Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context The behavior could be caused by a conflict between the code block that appends the when element in
peerProfile.ts
:and this check inside
setPeerStatus
inappImManager.ts
:Because of this check, the subtitle element doesn't get replaced while the user is typing, but a when element keeps getting appended to it. When the user is not typing, the subtitle is replaced after every update, and only a single when element is displayed.