Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Linter & Remove Unsafe React Lifecycle Events #552

Closed
wants to merge 13 commits into from
Closed
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Prev

Fix linting errors resulting from the merge with develop

  • Loading branch information
IAmThePan committed May 12, 2020
commit 0988a293828b4815c64c41867d912ba9d428ee45
@@ -161,8 +161,10 @@ const Click2PlayContentScript = (function(win, doc) {
if (name === 'c2p') {
if (message) {
// Dequeue C2P data stored while the script injection was taking place
for (const app_id in message) {
if (message.hasOwnProperty(app_id)) {
const messageKeys = Object.keys(message);
for (let i = 0; i < messageKeys.length; i++) {
const app_id = messageKeys[i];
if (Object.prototype.hasOwnProperty.call(message, app_id)) {
applyC2P(app_id, message[app_id].data, message[app_id].html);
delete message[app_id];
}
@@ -102,13 +102,14 @@ export function buildC2P(details, app_id) {
case 'none':
tabInfo.setTabInfo(tab_id, 'c2pStatus', 'loading');
// Push current C2P data into existing queue
if (!tab.c2pQueue.hasOwnProperty(app_id)) {
tabInfo.setTabInfo(tab_id, 'c2pQueue', Object.assign({}, tab.c2pQueue, {
if (!Object.prototype.hasOwnProperty.call(tab.c2pQueue, app_id)) {
tabInfo.setTabInfo(tab_id, 'c2pQueue', {
...tab.c2pQueue,
[app_id]: {
data: c2pApp,
html: c2pHtml
}
}));
});
}
// Scripts injected at document_idle are guaranteed to run after the DOM is complete
injectScript(tab_id, 'dist/click_to_play.js', '', 'document_idle').then(() => {
@@ -122,13 +123,14 @@ export function buildC2P(details, app_id) {
break;
case 'loading':
// Push C2P data to a holding queue until click_to_play.js has finished loading on the page
if (!tab.c2pQueue.hasOwnProperty(app_id)) {
tabInfo.setTabInfo(tab_id, 'c2pQueue', Object.assign({}, tab.c2pQueue, {
if (!Object.prototype.hasOwnProperty.call(tab.c2pQueue, app_id)) {
tabInfo.setTabInfo(tab_id, 'c2pQueue', {
...tab.c2pQueue,
[app_id]: {
data: c2pApp,
html: c2pHtml
}
}));
});
}
break;
case 'done':
@@ -194,7 +196,6 @@ export function allowAllwaysC2P(app_id, tab_host) {

// Remove fron site-specific-blocked
if (Object.prototype.hasOwnProperty.call(conf.site_specific_blocks, tab_host) && conf.site_specific_blocks[tab_host].includes(+app_id)) {
const index = conf.site_specific_blocks[tab_host].indexOf(+app_id);
const { site_specific_blocks } = conf;
site_specific_blocks[tab_host].splice(0, 1);
conf.site_specific_blocks = site_specific_blocks;
ProTip! Use n and p to navigate between commits in a pull request.