Fixed #115: High CPU usages while idling
authorAjay Bura <ajbura@gmail.com>
Sun, 26 Sep 2021 13:17:37 +0000 (18:47 +0530)
committerAjay Bura <ajbura@gmail.com>
Sun, 26 Sep 2021 13:17:37 +0000 (18:47 +0530)
Signed-off-by: Ajay Bura <ajbura@gmail.com>
src/app/organisms/room/RoomViewFloating.jsx
src/app/organisms/room/RoomViewFloating.scss

index 56b7a9be687ba26dc0f99c5c1898f1a84d58f25f..6ee66995c5387dca2550334d475e6b2403e19d9d 100644 (file)
@@ -54,7 +54,7 @@ function RoomViewFloating({
   return (
     <>
       <div className={`room-view__typing${isSomeoneTyping(typingMembers) ? ' room-view__typing--open' : ''}`}>
-        <div className="bouncingLoader"><div /></div>
+        <div className="bouncing-loader"><div /></div>
         <Text variant="b2">{getTypingMessage(typingMembers)}</Text>
       </div>
       <div className={`room-view__STB${reachedBottom ? '' : ' room-view__STB--open'}`}>
index 501c9f45c17773e253ca54a059981bb9e1a52ea7..8c4ba7d4b47c06c96f8a22c34eb79046f1063c2c 100644 (file)
@@ -9,10 +9,6 @@
       color: var(--tc-surface-high);
     }
 
-    &--open {
-      transform: translateY(-99%);
-    }
-
     & .text {
       flex: 1;
       min-width: 0;
       text-overflow: ellipsis;
       margin: 0 var(--sp-tight);
     }
+
+    &--open {
+      transform: translateY(-99%);
+      & .bouncing-loader {
+        & > *,
+        &::after,
+        &::before {
+          animation: bouncing-loader 0.6s infinite alternate;
+        }
+      }
+    }
   }
 
-  .bouncingLoader {
+  .bouncing-loader {
     transform: translateY(2px);
     margin: 0 calc(var(--sp-ultra-tight) / 2);
   }
-  .bouncingLoader > div,
-  .bouncingLoader:before,
-  .bouncingLoader:after {
+  .bouncing-loader > div,
+  .bouncing-loader::before,
+  .bouncing-loader::after {
     display: inline-block;
     width: 8px;
     height: 8px;
     background: var(--tc-surface-high);
     border-radius: 50%;
-    animation: bouncing-loader 0.6s infinite alternate;
   }
   
-  .bouncingLoader:before,
-  .bouncingLoader:after {
+  
+  .bouncing-loader::before,
+  .bouncing-loader::after {
     content: "";
   }
   
-  .bouncingLoader > div {
+  .bouncing-loader > div {
     margin: 0 4px;
   }
   
-  .bouncingLoader > div {
+  .bouncing-loader > div {
     animation-delay: 0.2s;
   }
   
-  .bouncingLoader:after {
+  .bouncing-loader::after {
     animation-delay: 0.4s;
   }