chat scrollback performance improved
authorunknown <ajbura@gmail.com>
Sat, 21 Aug 2021 13:09:21 +0000 (18:39 +0530)
committerunknown <ajbura@gmail.com>
Sat, 21 Aug 2021 13:09:21 +0000 (18:39 +0530)
src/app/molecules/message/Message.scss
src/app/organisms/channel/ChannelViewContent.jsx
src/client/state/RoomTimeline.js

index b9e02de81e51a76cfc2e0a9c4a5edebc7870ae1b..60886ca985f7163ab36495ae26159b320dd8e774 100644 (file)
   &-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);
     }
   }
 }
index f01e8b2d3d318f379e710e4ab98be9ca9b15a0a6..9f75e080659412806603a083b8b09c60214dd4cd 100644 (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}
index 13374543b16bad3e8fb936a811b7f7492bafcc95..f434ee82cce1ea97db9feac3060d8dd1da67b36a 100644 (file)
@@ -32,6 +32,7 @@ class RoomTimeline extends EventEmitter {
       }
 
       if (this.ongoingDecryptionCount !== 0) return;
+      if (this.isOngoingPagination) return;
       this.emit(cons.events.roomTimeline.EVENT);
     };