bug fixed. need to work on server notifi server si

This commit is contained in:
supertiger1234 2019-06-02 20:56:29 +01:00
parent 0fe79d64bd
commit 7365685802
6 changed files with 24 additions and 8 deletions

View file

@ -10,7 +10,7 @@
<div class="information">
<div :class="{name: true, clickable: !!uniqueID }" @click="openUserInfoPanel">{{name}}</div>
</div>
<div class="show-members-button" @click="toggleMembersPanel">
<div v-if="type === 2" class="show-members-button" @click="toggleMembersPanel">
<i class="material-icons">view_list</i>
</div>
</div>

View file

@ -4,7 +4,7 @@
<friends-list
class="left-panel"
v-click-outside="hideLeftPanel"
v-show="$mq === 'mobile' && showLeftPanel || $mq === 'desktop'"
v-show="$mq === 'mobile' && showLeftPanel || ($mq !== 'mobile')"
/>
</transition>
<message-panel/>

View file

@ -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;

View file

@ -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;
}

View file

@ -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();
}
}

View file

@ -12,12 +12,12 @@
Changelog
</div>
<div :class="{tab: true, selected: currentTab === 0, notifyAnimation: DMNotification}" @click="switchTab(1)">
<div :class="{tab: true, selected: currentTab === 1, notifyAnimation: DMNotification}" @click="switchTab(1)">
<i class="material-icons">chat</i>
Direct Message
</div>
<div :class="{tab: true, selected: currentTab === 0, notifyAnimation: serverNotification}" @click="switchTab(2)">
<div :class="{tab: true, selected: currentTab === 2, notifyAnimation: serverNotification}" @click="switchTab(2)">
<i class="material-icons">forum</i>
Servers
</div>
@ -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) {