FIX: removes stored scroll position in drawer (#20328)

This commit is contained in:
Joffrey JAFFEUX 2023-02-16 12:58:47 +01:00 committed by GitHub
parent 5720bb7b64
commit 7cc0c59469
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -84,12 +84,20 @@ export default class ChannelsList extends Component {
@action @action
storeScrollPosition() { storeScrollPosition() {
if (this.chatStateManager.isDrawerActive) {
return;
}
const scrollTop = document.querySelector(".channels-list")?.scrollTop || 0; const scrollTop = document.querySelector(".channels-list")?.scrollTop || 0;
this.session.channelsListPosition = scrollTop; this.session.channelsListPosition = scrollTop;
} }
@bind @bind
_applyScrollPosition() { _applyScrollPosition() {
if (this.chatStateManager.isDrawerActive) {
return;
}
const position = this.chatStateManager.isFullPageActive const position = this.chatStateManager.isFullPageActive
? this.session.channelsListPosition || 0 ? this.session.channelsListPosition || 0
: 0; : 0;