Browse Source

fix disappearing rate bar

hyperstown 2 năm trước cách đây
mục cha
commit
8eef50918d
1 tập tin đã thay đổi với 5 bổ sung9 xóa
  1. 5 9
      Extensions/combined/src/bar.js

+ 5 - 9
Extensions/combined/src/bar.js

@@ -10,9 +10,11 @@ import {
 import { cLog, getColorFromTheme } from "./utils";
 
 function createRateBar(likes, dislikes) {
+  let ratebar = document.getElementById("ryd-bar-container");
+  if (ratebar) {
+    ratebar.parentNode.removeChild(ratebar);
+  }
   if (!isLikesDisabled()) {
-    let rateBar = document.getElementById("ryd-bar-container");
-
     const widthPx =
       getLikeButton().clientWidth +
       getDislikeButton().clientWidth +
@@ -48,7 +50,7 @@ function createRateBar(likes, dislikes) {
     }
 
     if (!isShorts()) {
-      if (!rateBar && !isMobile()) {
+      if (!isMobile()) {
         let colorLikeStyle = "";
         let colorDislikeStyle = "";
         if (extConfig.coloredBar) {
@@ -110,12 +112,6 @@ function createRateBar(likes, dislikes) {
         }
       }
     }
-  } else {
-    cLog("removing bar");
-    let ratebar = document.getElementById("ryd-bar-container");
-    if (ratebar) {
-      ratebar.parentNode.removeChild(ratebar);
-    }
   }
 }