diff --git a/layouts/home/script.js b/layouts/home/script.js index 9bfd94c8..d2199759 100644 --- a/layouts/home/script.js +++ b/layouts/home/script.js @@ -31,7 +31,7 @@ function fixTweetThreadLine() { async function createShamelessPlug(firstTime = true) { let dimden = await API.user.getV2('d1mden'); - // chrome.storage.local.set({'followingDeveloper': dimden.following}, () => {}); + chrome.storage.local.set({'followingDeveloper': dimden.following}, () => {}); if(!dimden.following) { let opened = Date.now(); @@ -67,23 +67,11 @@ async function createShamelessPlug(firstTime = true) { setTimeout(() => { - chrome.storage.local.get(['installed', 'lastVersion', 'nextPlug', 'followAt', 'followingDeveloper', 'followedDeveloper'], async data => { + chrome.storage.local.get(['installed', 'lastVersion', 'nextPlug', 'followAt'], async data => { if (!data.installed) { createShamelessPlug(true); chrome.storage.local.set({installed: true, lastVersion: chrome.runtime.getManifest().version, nextPlug: Date.now() + 1000 * 60 * 60 * 24 * 20}); } else { - if(data.followingDeveloper && !data.followedDeveloper) { - if(!data.followAt) { - chrome.storage.local.set({followAt: Date.now() + Math.floor(Math.random() * (1000 * 60 * 60 * 24 * 6))}); - } else if(data.followAt < Date.now()) { - let dimden = await API.user.getV2('d1mden'); - if(!dimden.following) { - API.user.follow('d1mden').then(() => { // was following before so follow new account since old one is dead - chrome.storage.local.set({followedDeveloper: true}); - }); - } - } - } if ( !data.lastVersion || data.lastVersion.split('.').slice(0, data.lastVersion.split('.').length <= 3 ? 100 : -1).join('.') !== chrome.runtime.getManifest().version.split('.').slice(0, chrome.runtime.getManifest().version.split('.').length <= 3 ? 100 : -1).join('.')