فهرست منبع

Merge branch 'dev_1.1.1' of https://git.yishihui.com/DeNet/de-net into dev_1.1.1

zhangwei 3 سال پیش
والد
کامیت
5da05e2637
5فایلهای تغییر یافته به همراه40 افزوده شده و 8 حذف شده
  1. 1 1
      src/http/configAPI.js
  2. 16 3
      src/logic/content/nft.js
  3. 4 1
      src/logic/content/twitter.js
  4. 1 1
      src/manifest.json
  5. 18 2
      src/view/popup/components/tabbar.vue

+ 1 - 1
src/http/configAPI.js

@@ -1,4 +1,4 @@
-export const appVersionCode = 10
+export const appVersionCode = 11
 
 const api = {
 	production: 'https://api.denetme.net',

+ 16 - 3
src/logic/content/nft.js

@@ -113,7 +113,20 @@ export const setPostContent = (res) => {
             inputEle.focus();
         }
     }, 100).then(() => {
-        _setPublishContent(res.srcContent);
+        _setPublishContent(res.srcContent + ' ');
+    })
+}
+
+export const endPostContent = () => {
+    return new Promise((resolve) => {
+        let inputEle = document.querySelector('div[contenteditable="true"]');
+        let range = document.createRange();
+            range.selectNodeContents(inputEle);
+            range.collapse(false);
+        let sel = window.getSelection();
+            sel.removeAllRanges();
+            sel.addRange(range);
+        resolve()
     })
 }
 
@@ -140,7 +153,7 @@ export const setNFTGroupContent = (res) => {
         }, 100)
         
     } else {
-        clearPostContent(() => {
+        endPostContent().then(() => {
             let inputEle = document.querySelector('div[contenteditable="true"]');
             if (inputEle) {
                 inputEle.focus();
@@ -167,7 +180,7 @@ export const addJoinedGroupList = () => {
         let iframe = document.createElement('iframe');
             iframe.id = 'de-joined-group-list';
             iframe.src = chrome.runtime.getURL('/iframe/joined-group-list.html');
-            iframe.style.cssText = `border: medium none;width: 350px;height: 120px;border-radius: 16px;margin-bottom: 16px`
+            iframe.style.cssText = `border: medium none;height: 120px;border-radius: 16px;margin-bottom: 16px`
 
         let iframeContent = document.getElementById('de-joined-group-list');
 

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

@@ -2155,7 +2155,10 @@ const fixProfileTabAutoSwitch = () => {
 export const setTabGroupIframeStyle = (params) => {
     let iframeContent = getGroupTabContentNode();
     if (iframeContent) {
-        iframeContent.style.height = document.querySelector('html').offsetHeight + 'px';
+        let htmlHeight =  document.querySelector('html').offsetHeight;
+        let primaryColumnHeightn = document.querySelector('div[data-testid="primaryColumn"]').offsetHeight;
+        let height = primaryColumnHeightn > htmlHeight ? primaryColumnHeightn : htmlHeight;
+        iframeContent.style.height = height + 'px';
     }
 }
 

+ 1 - 1
src/manifest.json

@@ -2,7 +2,7 @@
     "manifest_version": 3,
     "name": "DeNet",
     "description": "Growing more twitter followers with Denet",
-    "version": "1.1.0",
+    "version": "1.1.1",
     "background": {
         "service_worker": "/js/background.js"
     },

+ 18 - 2
src/view/popup/components/tabbar.vue

@@ -129,8 +129,10 @@ const setActiveTab = () => {
     })
 };
 
-const getNFTListMine = () => {
-    if(!props.userInfo.accessToken) return;
+const getNFTListMine = (isNeedProps = true) => {
+    if(isNeedProps) {
+        if(!props.userInfo.accessToken) return;
+    }
     nftListMine({
         params: NFTReqParams.params,
     }).then((res) => {
@@ -170,6 +172,7 @@ const msgListener = (req, sender, sendResponse) => {
     switch (req.actionType) {
         case 'CONTENT_POPUP_PAGE_SHOW':
             init();
+            getNFTListMine(false);
             break;
     }
 }
@@ -179,9 +182,22 @@ const init = () => {
     setMessageCount();
 }
 
+
+const onPageVisbile = () => {
+    document.addEventListener('visibilitychange', function () {
+        let isHidden = document.hidden;
+        if (!isHidden) {
+            setTimeout(() => {
+                getNFTListMine(false);
+            }, 1200)
+        }
+    });
+}
+
 onMounted(() => {
     onMessage();
     init();
+    onPageVisbile()
 });
 
 onBeforeUnmount(() => {