mirror of
https://github.com/tubearchivist/browser-extension.git
synced 2024-11-22 11:40:13 +00:00
Revert "delay buildChannelButton to account for UI refresh on YT"
This reverts commit aaa04a43b5
.
This commit is contained in:
parent
aaa04a43b5
commit
c570aff66d
@ -6,7 +6,6 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
env: {
|
env: {
|
||||||
browser: true,
|
browser: true,
|
||||||
es6: true,
|
|
||||||
},
|
},
|
||||||
globals: {
|
globals: {
|
||||||
browser: 'readonly',
|
browser: 'readonly',
|
||||||
|
@ -124,13 +124,13 @@ function isElementVisible(element) {
|
|||||||
|
|
||||||
function ensureTALinks() {
|
function ensureTALinks() {
|
||||||
let channelContainerNodes = getChannelContainers();
|
let channelContainerNodes = getChannelContainers();
|
||||||
|
|
||||||
for (let channelContainer of channelContainerNodes) {
|
for (let channelContainer of channelContainerNodes) {
|
||||||
channelContainer = adjustOwner(channelContainer);
|
channelContainer = adjustOwner(channelContainer);
|
||||||
if (channelContainer.hasTA) continue;
|
if (channelContainer.hasTA) continue;
|
||||||
channelContainer.hasTA = true;
|
let channelButton = buildChannelButton(channelContainer);
|
||||||
buildChannelButton(channelContainer).then(channelButton => {
|
|
||||||
channelContainer.appendChild(channelButton);
|
channelContainer.appendChild(channelButton);
|
||||||
});
|
channelContainer.hasTA = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let titleContainerNodes = getTitleContainers();
|
let titleContainerNodes = getTitleContainers();
|
||||||
@ -150,25 +150,19 @@ function adjustOwner(channelContainer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buildChannelButton(channelContainer) {
|
function buildChannelButton(channelContainer) {
|
||||||
return new Promise(resolve => {
|
let channelHandle = getChannelHandle(channelContainer);
|
||||||
let buttonDiv;
|
let buttonDiv = buildChannelButtonDiv();
|
||||||
let channelSubButton;
|
|
||||||
let spacer;
|
|
||||||
let channelDownloadButton;
|
|
||||||
|
|
||||||
// Delayed execution for interface to refresh
|
let channelSubButton = buildChannelSubButton(channelHandle);
|
||||||
setTimeout(() => {
|
|
||||||
const channelHandle = getChannelHandle(channelContainer);
|
|
||||||
buttonDiv = buildChannelButtonDiv();
|
|
||||||
channelSubButton = buildChannelSubButton(channelHandle);
|
|
||||||
spacer = buildSpacer();
|
|
||||||
channelDownloadButton = buildChannelDownloadButton();
|
|
||||||
buttonDiv.appendChild(channelSubButton);
|
buttonDiv.appendChild(channelSubButton);
|
||||||
|
|
||||||
|
let spacer = buildSpacer();
|
||||||
buttonDiv.appendChild(spacer);
|
buttonDiv.appendChild(spacer);
|
||||||
|
|
||||||
|
let channelDownloadButton = buildChannelDownloadButton();
|
||||||
buttonDiv.appendChild(channelDownloadButton);
|
buttonDiv.appendChild(channelDownloadButton);
|
||||||
resolve(buttonDiv);
|
|
||||||
}, 2000);
|
return buttonDiv;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getChannelHandle(channelContainer) {
|
function getChannelHandle(channelContainer) {
|
||||||
|
Loading…
Reference in New Issue
Block a user