fixed bug ##283

die messages der einschreibung werden nun getrennt. dafür aber gestackt.
This commit is contained in:
Tim Gröger 2020-06-10 14:41:12 +02:00
parent fd9784cfe3
commit 62756d3cec
3 changed files with 20 additions and 9 deletions

View File

@ -214,15 +214,23 @@
</v-card-text>
</v-card>
<v-snackbar
v-for="message in messages"
:key="messages.indexOf(message)"
:color="message.error ? 'error' : 'success'"
color="success"
bottom
:timeout="0"
:multi-line="true"
v-model="message.visible"
:value="messages.length > 0 ? messages[0].visible : test"
vertical
>
{{ createMessage(message) }}
<v-list-item v-for="message in messages"
:key="messages.indexOf(message)"
style="background-color: #4CAF50;"
v-show="message.visible">
<v-list-item-content>
<v-list-item-title style="color: white">
{{ createMessage(message) }}
</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-snackbar>
</v-container>
</div>
@ -249,7 +257,8 @@ export default {
componentRenderer: 0,
timer: '',
stornoMessage: null,
checkValidate: false
checkValidate: false,
test: null
}
},
created() {
@ -270,7 +279,7 @@ export default {
user.timeout = setTimeout(() => {
this.addAmount({username: user.username,
amount: user.toSetAmount,
user})
user: user})
setTimeout(() => {
user.toSetAmount = null
}, 300)

View File

@ -86,8 +86,10 @@ const mutations = {
},
addMessage: (state, data) => {
var message = null
console.log(data)
if (state.messages.length > 0) {
if (state.messages[0].user.id === data.user.id && !data.error) {
console.log(state.messages[0].user.username, data.user.username)
if (state.messages[0].user.username === data.user.username && !data.error) {
message = state.messages[0]
if ((new Date() - state.messages[0].date) / 1000 < 2) {
clearTimeout(message.timeout)

View File

@ -165,7 +165,7 @@ const mutations = {
addMessage: (state, data) => {
var message = null
if (state.messages.length > 0) {
if (state.messages[0].user.id === data.user.id && !data.error) {
if (state.messages[0].user.username === data.user.username && !data.error) {
message = state.messages[0]
if ((new Date() - state.messages[0].date) / 1000 < 2) {
clearTimeout(message.timeout)