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 { &-btns button {
margin: var(--sp-tight) var(--sp-tight) 0 0; margin: var(--sp-tight) var(--sp-tight) 0 0;
[dir=rtl] & { [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() { function genPlaceholders() {
return ( return (
<> <>
<PlaceholderMessage key={Math.random().toString(20).substr(2, 6)} /> <PlaceholderMessage key="placeholder-1" />
<PlaceholderMessage key={Math.random().toString(20).substr(2, 6)} /> <PlaceholderMessage key="placeholder-2" />
<PlaceholderMessage key={Math.random().toString(20).substr(2, 6)} /> <PlaceholderMessage key="placeholder-3" />
</> </>
); );
} }
@ -139,7 +139,7 @@ function genChannelIntro(mEvent, roomTimeline) {
avatarSrc = isDM ? roomTimeline.room.getAvatarFallbackMember()?.getAvatarUrl(mx.baseUrl, 80, 80, 'crop') : avatarSrc; avatarSrc = isDM ? roomTimeline.room.getAvatarFallbackMember()?.getAvatarUrl(mx.baseUrl, 80, 80, 'crop') : avatarSrc;
return ( return (
<ChannelIntro <ChannelIntro
key={mEvent ? mEvent.getId() : Math.random().toString(20).substr(2, 6)} key={mEvent ? mEvent.getId() : 'channel-intro'}
roomId={roomTimeline.roomId} roomId={roomTimeline.roomId}
avatarSrc={avatarSrc} avatarSrc={avatarSrc}
name={roomTimeline.room.name} name={roomTimeline.room.name}

View file

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