notification sound fixes

This commit is contained in:
supertiger1234 2019-06-02 19:04:52 +01:00
parent 1a08e6e5d5
commit 830ae0f9f5
3 changed files with 54 additions and 7 deletions

View file

@ -1,6 +1,6 @@
<template>
<div :class="{server: true, 'add-server': mode === 'ADD_SERVER'}">
<div class="small-view">
<div :class="{'small-view': true, notifyAnimation: notification}">
<profile-picture size="50px" v-if="!mode" :url="tempImage"/>
<div class="add-icon" v-if="mode === 'ADD_SERVER'">
<i class="material-icons">add</i>
@ -83,12 +83,53 @@ export default {
computed: {
user() {
return this.$store.getters.user;
},
notification() {
const notifications = this.$store.getters.notifications;
const channels = this.$store.getters.channels
const notification = notifications.find(e => {
return channels[e.channelID] && channels[e.channelID].server_id && this.ServerData && channels[e.channelID].server_id === this.ServerData.server_id
})
return notification;
}
}
};
</script>
<style scoped>
.notifyAnimation:before{
content: '';
position: absolute;
z-index: -1;
top: 0;
left: 0;
right: 0;
bottom: 0;
animation: notifyAnime;
animation-duration: 1s;
animation-iteration-count: infinite;
animation-fill-mode: forwards;
border-radius: 5px;
}
@keyframes notifyAnime {
0%{
background: rgba(255, 0, 0, 0.198);
}
40%{
background: rgba(255, 0, 0, 0.411);
}
60%{
background: rgba(255, 0, 0, 0.411);
}
100%{
background: rgba(255, 0, 0, 0.198);
}
}
.server {
color: white;
display: flex;

View file

@ -20,10 +20,12 @@ const config = [
date: "27/05/2019",
headColor: "rgba(155, 244, 66, 0.77)",
new: [
"When switching from server to direct message tab (and vice versa), the channels should now be seperated.",
"Notifications for servers has been added."
],
fix: [
''
"Fixed notification bug where server notification are shown in dms",
"When switching from server to direct message tab (and vice versa), the channels should now be separated.",
'You can now only create 30 invites per server.'
],
next: [""]
},

View file

@ -4,16 +4,20 @@ import {
store
} from '@/store/index';
//init audio
const notificationAudio = new Audio(notificationSound);
const newFriendAudio = new Audio(newFriendSound);
export default {
notification: () => {
if (isBusy()) return;
const audio = new Audio(notificationSound);
audio.play();
notificationAudio.play();
},
newFriend: () => {
if (isBusy()) return;
const audio = new Audio(newFriendSound);
audio.play();
newFriendAudio.play();
}
}