소스 검색

[fix] bug

wenliming 2 년 전
부모
커밋
850d35d5d5
1개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 7 4
      src/logic/content/twitter.js

+ 7 - 4
src/logic/content/twitter.js

@@ -176,7 +176,10 @@ function _addDeNetEditBtn(parent, dom, isClick = false) {
                         businessType: Report.businessType.buttonView,
                         objectType: Report.objectType.buttonSecond
                     });
-                    parent.parentNode.insertBefore(dom, parent.nextElementSibling);
+                    let innerDeIcon = document.getElementById('de-btn1');
+                    if (!innerDeIcon) {
+                        parent.parentNode.insertBefore(dom, parent.nextElementSibling);
+                    }
                 }
             }, 1000)
         }
@@ -286,7 +289,7 @@ function _deNetBtnClick() {
             setTimeout(() => {
                 dom.loadingImg.style.transform = 'rotate(0deg)'
                 dom.deBtn.innerHTML = '<span>DeNet<span>';
-            }, 3000)
+            }, 2000)
 
             chrome.runtime.sendMessage({ actionType: "CONTENT_TWITTER_LOGIN", data: '1' }, (res) => { console.log(res) })
         }
@@ -299,7 +302,7 @@ function _deNetBtnClick() {
  * @private
  */
 let isSetContent = false;
-function _setPublishContent(content) {
+const _setPublishContent = throttle(function (content) {
     if (!isSetContent) {
         isSetContent = true;
         setTimeout(() => {
@@ -309,7 +312,7 @@ function _setPublishContent(content) {
             }, 2000)
         }, 1000);
     }
-}
+}, 800);
 
 /**
  * 创建deNet按钮 添加到页面