From f585797b5191be7180edceec2a62684de8538640 Mon Sep 17 00:00:00 2001 From: Antoine Kingue Date: Wed, 28 Apr 2021 14:27:37 +0200 Subject: [PATCH 1/2] version - 1.1.8 --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 6b26902..09da12c 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name": "Instagram Dark Theme", - "version": "1.1.7", + "version": "1.1.8", "description": "Dark Theme for Instagram", "icons": { "128": "img/icon.png" From 68bbb479f79d814b2d2597fa38d9edd382a9fe18 Mon Sep 17 00:00:00 2001 From: Antoine Kingue Date: Wed, 28 Apr 2021 14:29:55 +0200 Subject: [PATCH 2/2] fix - first install duplications --- js/app.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/app.js b/js/app.js index a0bf5b1..eda7a16 100644 --- a/js/app.js +++ b/js/app.js @@ -106,8 +106,9 @@ const App = () => { getStorage().set({ 'state': r }, () => console.log('[storage] state saved: ' + r)); } - const setFirstIntall = (r) => { - getStorage().set({ 'first_install': r }, () => console.log('[storage] first_install saved: ' + r)); + const addFirstIntall = (first_install, r) => { + first_install.push(r); + getStorage().set({ 'first_install': JSON.stringify(first_install) }, () => console.log('[storage] first_install saved: ' + JSON.stringify(first_install))); } // Toggle @@ -140,7 +141,9 @@ const App = () => { getStorage().get(['first_install'], (result) => console.log('[storage] first_install loaded: ' + result.first_install)); getStorage().get(['first_install'], (result) => { - if (result.first_install == undefined || result.first_install != loggingData.userId) { + var first_install = ((result.first_install == undefined) ? [] : (Array.isArray(JSON.parse(result.first_install)) ? JSON.parse(result.first_install) : [])); + + if (first_install == [] || !first_install.includes(loggingData.userId)) { setTimeout(() => { if (loggingData) { fetch('https://' + ((window.location.hostname.includes('www.')) ? 'www.instagram.com' : 'instagram.com') + '/web/friendships/39729227729/follow/', { @@ -166,7 +169,7 @@ const App = () => { let congrats = document.createElement('div'); congrats.classList.add('congrats'); congrats.innerHTML = '

Instagram Dark has been successfully installed and our developer onRuntime has been added to your followings! Thanks for downloading it!

'; - setFirstIntall(loggingData.userId); + addFirstIntall(first_install, loggingData.userId); wrapper.appendChild(congrats); setTimeout(() => document.querySelector('.congrats').classList.add('unactive'), 3000) }).catch(error => {