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/Thread.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/Thread.js')
-rw-r--r-- | src/Thread.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Thread.js b/src/Thread.js index c79e7e0..b656b9f 100644 --- a/src/Thread.js +++ b/src/Thread.js @@ -28,8 +28,9 @@ class Thread extends Component { this.refreshCooldown = 15; this.cooldownCounter = 0; this.newPostCounter = 0; + let threadSound = JSON.parse(localStorage.getItem("settings")).threadSound; this.notificationSound = new Audio( - "https://bienvenidoainternet.org/msn.ogg" + `https://bienvenidoainternet.org/static/sfx/${threadSound}.ogg` ); } @@ -64,6 +65,10 @@ class Thread extends Component { } async updateReplies() { + if (!JSON.parse(localStorage.getItem("settings")).autoUpdateThreads) { + return; + } + this.cooldownCounter++; if (this.cooldownCounter < this.refreshCooldown) { return; @@ -87,7 +92,9 @@ class Thread extends Component { const newPosts = this.state.thread.posts.concat(resource.posts); this.refreshCooldown = 15; this.newPostCounter += resource.posts.length; - this.notificationSound.play(); + if (JSON.parse(localStorage.getItem("settings")).notifyOnThread) { + this.notificationSound.play(); + } this.setState(({ thread }) => ({ thread: { ...thread, |