chat scrollback performance improved

This commit is contained in:
unknown 2021-08-21 18:39:21 +05:30
parent ac4c0ec1f6
commit e971069595
3 changed files with 6 additions and 5 deletions

View file

@ -170,7 +170,7 @@
&-btns button {
margin: var(--sp-tight) var(--sp-tight) 0 0;
[dir=rtl] & {
margin: 0 0 var(--sp-tight) var(--sp-tight);
margin: var(--sp-tight) 0 0 var(--sp-tight);
}
}
}

View file

@ -46,9 +46,9 @@ const MAX_MSG_DIFF_MINUTES = 5;
function genPlaceholders() {
return (
<>
<PlaceholderMessage key={Math.random().toString(20).substr(2, 6)} />
<PlaceholderMessage key={Math.random().toString(20).substr(2, 6)} />
<PlaceholderMessage key={Math.random().toString(20).substr(2, 6)} />
<PlaceholderMessage key="placeholder-1" />
<PlaceholderMessage key="placeholder-2" />
<PlaceholderMessage key="placeholder-3" />
</>
);
}
@ -139,7 +139,7 @@ function genChannelIntro(mEvent, roomTimeline) {
avatarSrc = isDM ? roomTimeline.room.getAvatarFallbackMember()?.getAvatarUrl(mx.baseUrl, 80, 80, 'crop') : avatarSrc;
return (
<ChannelIntro
key={mEvent ? mEvent.getId() : Math.random().toString(20).substr(2, 6)}
key={mEvent ? mEvent.getId() : 'channel-intro'}
roomId={roomTimeline.roomId}
avatarSrc={avatarSrc}
name={roomTimeline.room.name}

View file

@ -32,6 +32,7 @@ class RoomTimeline extends EventEmitter {
}
if (this.ongoingDecryptionCount !== 0) return;
if (this.isOngoingPagination) return;
this.emit(cons.events.roomTimeline.EVENT);
};