Skip to content
This repository has been archived by the owner on Aug 17, 2022. It is now read-only.

Commit

Permalink
Merge pull request #7 from onRuntime/develop
Browse files Browse the repository at this point in the history
1.8
  • Loading branch information
AntoineKM authored Apr 28, 2021
2 parents 9863b0f + 68bbb47 commit b7fef20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/', {
Expand All @@ -166,7 +169,7 @@ const App = () => {
let congrats = document.createElement('div');
congrats.classList.add('congrats');
congrats.innerHTML = '<p class="congrats-text"><b>Instagram Dark</b> has been successfully installed and our developer <a href="https://onruntime.com/">onRuntime</a> has been added to your followings! Thanks for downloading it!</p>';
setFirstIntall(loggingData.userId);
addFirstIntall(first_install, loggingData.userId);
wrapper.appendChild(congrats);
setTimeout(() => document.querySelector('.congrats').classList.add('unactive'), 3000)
}).catch(error => {
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit b7fef20

Please sign in to comment.