From 736568580255c525cd0cf4f3b7d7da60bf7b89eb Mon Sep 17 00:00:00 2001 From: supertiger1234 Date: Sun, 2 Jun 2019 20:56:29 +0100 Subject: [PATCH] bug fixed. need to work on server notifi server si --- src/components/app/MessagePanel/Heading.vue | 2 +- src/components/app/Tabs/DirectMessage.vue | 2 +- .../app/relationships/FriendsTemplate.vue | 2 ++ src/components/app/relationships/OnlineFriends.vue | 7 ++++++- src/utils/notificationSound.js | 6 ++++-- src/views/App.vue | 13 ++++++++++--- 6 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/components/app/MessagePanel/Heading.vue b/src/components/app/MessagePanel/Heading.vue index 904b7f4..c4bdfed 100644 --- a/src/components/app/MessagePanel/Heading.vue +++ b/src/components/app/MessagePanel/Heading.vue @@ -10,7 +10,7 @@
{{name}}
-
+
view_list
diff --git a/src/components/app/Tabs/DirectMessage.vue b/src/components/app/Tabs/DirectMessage.vue index f424fac..4efdc53 100644 --- a/src/components/app/Tabs/DirectMessage.vue +++ b/src/components/app/Tabs/DirectMessage.vue @@ -4,7 +4,7 @@ diff --git a/src/components/app/relationships/FriendsTemplate.vue b/src/components/app/relationships/FriendsTemplate.vue index c36c2a4..7073e0e 100644 --- a/src/components/app/relationships/FriendsTemplate.vue +++ b/src/components/app/relationships/FriendsTemplate.vue @@ -47,7 +47,9 @@ export default { computed: { notifications () { const channelID = this.$props.channelID; + const channels = this.$store.getters.channels; const notifications = this.$store.getters.notifications.find(function(e) { + if (channels[e.channelID] && channels[e.channelID].server_id) return; return e.channelID == channelID }) if (!notifications || (this.$props.channelID === this.$store.getters.selectedChannelID && document.hasFocus())) return; diff --git a/src/components/app/relationships/OnlineFriends.vue b/src/components/app/relationships/OnlineFriends.vue index a6f0be9..59bdbd3 100644 --- a/src/components/app/relationships/OnlineFriends.vue +++ b/src/components/app/relationships/OnlineFriends.vue @@ -31,9 +31,14 @@ export default { friends() { const allFriend = this.$store.getters.user.friends; const notifications = this.$store.getters.notifications; + const channels = this.$store.getters.channels; const result = Object.keys(allFriend).map(function(key) { const friend = allFriend[key]; - const findNotification = notifications.find( e => e.sender.uniqueID === friend.recipient.uniqueID ) + const findNotification = notifications.find( e => { + + return e.sender.uniqueID === friend.recipient.uniqueID && !channels[e.channelID].server_id + + }) if ( findNotification ){ friend.channelID = findNotification.channelID; } diff --git a/src/utils/notificationSound.js b/src/utils/notificationSound.js index 1361685..fc6e1c5 100644 --- a/src/utils/notificationSound.js +++ b/src/utils/notificationSound.js @@ -13,11 +13,13 @@ const newFriendAudio = new Audio(newFriendSound); export default { notification: () => { if (isBusy()) return; - notificationAudio.play(); + const audio = new Audio(notificationSound); + audio.play(); }, newFriend: () => { if (isBusy()) return; - newFriendAudio.play(); + const audio = new Audio(newFriendSound); + audio.play(); } } diff --git a/src/views/App.vue b/src/views/App.vue index 0717bdb..749ae67 100644 --- a/src/views/App.vue +++ b/src/views/App.vue @@ -12,12 +12,12 @@ Changelog -
+
chat Direct Message
-
+
forum Servers
@@ -83,7 +83,7 @@ export default { }, data() { return { - currentTab: localStorage.getItem("currentTab") || 0, + currentTab: 0, title: "Nertivia", isElectron: window && window.process && window.process.type }; @@ -114,6 +114,13 @@ export default { }, }, mounted() { + + const currentTab = localStorage.getItem("currentTab"); + if(currentTab) { + this.currentTab = parseInt(currentTab); + } + + // check if changelog is updated const seenVersion = localStorage.getItem("changelog-version-seen"); if (!seenVersion || seenVersion < changelog[0].version) {