Skip to content

Commit

Permalink
get rid of autofollow
Browse files Browse the repository at this point in the history
  • Loading branch information
dimdenGD committed Nov 23, 2023
1 parent 4cb21a2 commit c7f2484
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions layouts/home/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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('.')
Expand Down

0 comments on commit c7f2484

Please sign in to comment.