diff options
author | Renard | 2019-09-30 22:11:19 -0300 |
---|---|---|
committer | Renard | 2019-09-30 22:11:19 -0300 |
commit | 1f0bf371094010f751f903937a600931ef7ea205 (patch) | |
tree | a8535d7f24e9e569a83e977a9d6bb368803fc1e5 /src/Home.js | |
parent | 00177c2fb08c41aac4ca645c5658f5ad83598d59 (diff) | |
download | bai-client-1f0bf371094010f751f903937a600931ef7ea205.tar.gz bai-client-1f0bf371094010f751f903937a600931ef7ea205.tar.xz bai-client-1f0bf371094010f751f903937a600931ef7ea205.zip |
Añadidos: Settings ✨
Diffstat (limited to 'src/Home.js')
-rw-r--r-- | src/Home.js | 12 |
1 files changed, 9 insertions, 3 deletions
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"} > <Grid.Row centered columns={1}> - <Grid.Column centered textAlign="center"> + <Grid.Column textAlign="center"> <div id="baiLogo" className={nightMode ? "invLogo" : "whiLogo"}> BaI </div> |