Skip to content

Commit

Permalink
use new variables for sound and title bar notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
zyuhel committed Nov 30, 2017
1 parent fbda5c2 commit 7f828c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default {
setInterval(
(function (self) {
return function () {
if (self.$store.state.newChats.total > 0 && (self.$store.state.notificationMethod === 'sound_and_title' || self.$store.state.notificationMethod === 'only_title')) {
if (self.$store.state.newChats.total > 0 && (self.$store.state.notifyBar)) {
if (window.notify_amount !== self.$store.state.newChats.total) {
if (window.notify_interval) {
clearInterval(window.notify_interval)
Expand Down
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,14 @@ const store = new Vuex.Store({
state.newChats['total'] = 0
}
Vue.set(state.newChats, 'total', state.newChats['total'] + 1)
if (state.notificationMethod === 'only_sound' || state.notificationMethod === 'sound_and_title') {
if (state.notifySound) {
try {
document.getElementById('messageSound').play()
} catch (e) {
}
}
} else if (direction === 'to' && state.trackNewMessages && document.hidden) {
if (state.notificationMethod === 'only_sound' || state.notificationMethod === 'sound_and_title') {
if (state.notifySound) {
try {
document.getElementById('messageSound').play()
} catch (e) {
Expand Down

0 comments on commit 7f828c5

Please sign in to comment.