From 1f0bf371094010f751f903937a600931ef7ea205 Mon Sep 17 00:00:00 2001 From: Renard Date: Mon, 30 Sep 2019 22:11:19 -0300 Subject: Añadidos: Settings ✨ --- src/Home.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/Home.js') diff --git a/src/Home.js b/src/Home.js index 0cdad72..1695ed4 100644 --- a/src/Home.js +++ b/src/Home.js @@ -19,8 +19,9 @@ class Home extends Component { this.refreshCooldown = 15; this.cooldownCounter = 0; this.lastTimeNoAge = 0; + let homeSound = JSON.parse(localStorage.getItem("settings")).homeSound; this.notificationSound = new Audio( - "https://bienvenidoainternet.org/msn.ogg" + `https://bienvenidoainternet.org/static/sfx/${homeSound}.ogg` ); this.handeMouseMove = this.handeMouseMove.bind(this); this.mouseVars = {}; @@ -77,6 +78,9 @@ class Home extends Component { } async updateAges() { + if (!JSON.parse(localStorage.getItem("settings")).autoUpdateThreads) { + return; + } this.cooldownCounter++; if (this.cooldownCounter < this.refreshCooldown) { return; @@ -96,7 +100,9 @@ class Home extends Component { lastAgeThreads: resource.threads }); this.refreshCooldown = 30; - this.notificationSound.play(); + if (JSON.parse(localStorage.getItem("settings")).notifyOnHome) { + this.notificationSound.play(); + } } else { this.refreshCooldown += 15; this.lastTimeNoAge = resource.time; @@ -131,7 +137,7 @@ class Home extends Component { className={nightMode ? "homeContainer inverted" : "homeContainer"} > - + -- cgit v1.2.1-18-gbd029