|
@@ -1411,15 +1411,25 @@ export function publishNFTTweetEvent({ groupId, postId, srcContent }, callback)
|
|
groupFontWeight: '500',
|
|
groupFontWeight: '500',
|
|
lineDisplay: 'none'
|
|
lineDisplay: 'none'
|
|
});
|
|
});
|
|
- chrome.runtime.sendMessage({
|
|
|
|
- actionType: "SWITCH_GROUP_BANNER_STATUS",
|
|
|
|
- data: { type: 'arrow' }
|
|
|
|
- }, () => { });
|
|
|
|
|
|
+ sendMessageToGroupBanner({ type: 'arrow' })
|
|
}, 2000);
|
|
}, 2000);
|
|
});
|
|
});
|
|
}, 800)
|
|
}, 800)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const sendMessageToGroupBanner = (params) => {
|
|
|
|
+ chrome.runtime.sendMessage({
|
|
|
|
+ actionType: "SWITCH_GROUP_BANNER_STATUS",
|
|
|
|
+ data: params
|
|
|
|
+ }, (res) => {
|
|
|
|
+ if (!res) {
|
|
|
|
+ Report.reportLog({
|
|
|
|
+ objectType: Report.objectType.chrome_extension_sendmessage_error
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
export const publishNFTTweetPost = ({ postId, srcContent, groupId }) => {
|
|
export const publishNFTTweetPost = ({ postId, srcContent, groupId }) => {
|
|
let inputEle = document.querySelector('div[contenteditable="true"]');
|
|
let inputEle = document.querySelector('div[contenteditable="true"]');
|
|
let textContent = inputEle.innerText
|
|
let textContent = inputEle.innerText
|
|
@@ -1845,10 +1855,7 @@ const groupBtnStyleChange = () => {
|
|
if (line) {
|
|
if (line) {
|
|
let { display } = line.style;
|
|
let { display } = line.style;
|
|
if (display != 'none') {
|
|
if (display != 'none') {
|
|
- chrome.runtime.sendMessage({
|
|
|
|
- actionType: "SWITCH_GROUP_BANNER_STATUS",
|
|
|
|
- data: { type: 'btn' }
|
|
|
|
- }, () => { });
|
|
|
|
|
|
+ sendMessageToGroupBanner({ type: 'btn' })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1986,10 +1993,7 @@ const addGroupTabEventListener = () => {
|
|
|
|
|
|
let tipsDom = document.querySelector('#denet_group_banner');
|
|
let tipsDom = document.querySelector('#denet_group_banner');
|
|
if (tipsDom) {
|
|
if (tipsDom) {
|
|
- chrome.runtime.sendMessage({
|
|
|
|
- actionType: "SWITCH_GROUP_BANNER_STATUS",
|
|
|
|
- data: { type: 'btn' }
|
|
|
|
- }, () => { });
|
|
|
|
|
|
+ sendMessageToGroupBanner({ type: 'btn' })
|
|
} else {
|
|
} else {
|
|
onShowGroupBanner();
|
|
onShowGroupBanner();
|
|
}
|
|
}
|
|
@@ -2000,10 +2004,7 @@ const onShowGroupBanner = () => {
|
|
chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
|
|
chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
|
|
switch (req.actionType) {
|
|
switch (req.actionType) {
|
|
case 'IFRAME_SHOW_GROUP_TIP':
|
|
case 'IFRAME_SHOW_GROUP_TIP':
|
|
- chrome.runtime.sendMessage({
|
|
|
|
- actionType: "SWITCH_GROUP_BANNER_STATUS",
|
|
|
|
- data: { type: 'btn' }
|
|
|
|
- }, () => { });
|
|
|
|
|
|
+ sendMessageToGroupBanner({ type: 'btn' })
|
|
if (!getGroupTabNode()) {
|
|
if (!getGroupTabNode()) {
|
|
addGroupTab();
|
|
addGroupTab();
|
|
}
|
|
}
|
|
@@ -2080,10 +2081,7 @@ const TweetTabEventHandler = () => {
|
|
display: 'block'
|
|
display: 'block'
|
|
});
|
|
});
|
|
|
|
|
|
- chrome.runtime.sendMessage({
|
|
|
|
- actionType: "SWITCH_GROUP_BANNER_STATUS",
|
|
|
|
- data: { type: 'arrow' }
|
|
|
|
- }, () => { });
|
|
|
|
|
|
+ sendMessageToGroupBanner({ type: 'arrow' })
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|