Achievements Fixes (#11540)

* achievements fixes to timeout and modal

* fix string
This commit is contained in:
Matteo Pagliazzi
2019-11-13 21:59:48 +01:00
committed by GitHub
parent 3c4d8949de
commit 2842087a43
2 changed files with 17 additions and 5 deletions

View File

@@ -184,11 +184,19 @@ const NOTIFICATIONS = {
achievement: true, achievement: true,
label: $t => `${$t('achievement')}: ${$t('achievementPartyUp')}`, label: $t => `${$t('achievement')}: ${$t('achievementPartyUp')}`,
modalId: 'generic-achievement', modalId: 'generic-achievement',
data: {
message: $t => $t('achievement'),
modalText: $t => $t('achievementPartyUp'),
},
}, },
ACHIEVEMENT_PARTY_ON: { ACHIEVEMENT_PARTY_ON: {
achievement: true, achievement: true,
label: $t => `${$t('achievement')}: ${$t('achievementPartyOn')}`, label: $t => `${$t('achievement')}: ${$t('achievementPartyOn')}`,
modalId: 'generic-achievement', modalId: 'generic-achievement',
data: {
message: $t => $t('achievement'),
modalText: $t => $t('achievementPartyOn'),
},
}, },
ACHIEVEMENT_BEAST_MASTER: { ACHIEVEMENT_BEAST_MASTER: {
achievement: true, achievement: true,
@@ -196,7 +204,7 @@ const NOTIFICATIONS = {
modalId: 'generic-achievement', modalId: 'generic-achievement',
data: { data: {
message: $t => $t('achievement'), message: $t => $t('achievement'),
modalText: $t => $t('mountAchievement'), modalText: $t => $t('beastAchievement'),
}, },
}, },
ACHIEVEMENT_MOUNT_MASTER: { ACHIEVEMENT_MOUNT_MASTER: {
@@ -445,10 +453,10 @@ export default {
data = notification.data; data = notification.data;
} }
if (!data.modalText && config.data.modalText) { if (!data.modalText && config && config.data && config.data.modalText) {
data.modalText = config.data.modalText(this.$t); data.modalText = config.data.modalText(this.$t);
} }
if (!data.message && config.data.message) { if (!data.message && config && config.data && config.data.message) {
data.message = config.data.message(this.$t); data.message = config.data.message(this.$t);
} }

View File

@@ -215,8 +215,12 @@ export default {
}, },
}, },
created () { created () {
const timeout = this.notification && this.notification.timeout const timeout = (
? this.notification.timeout : true; this.notification
&& this.notification.timeout !== undefined
&& this.notification.timeout !== null
) ? this.notification.timeout : true;
if (timeout) { if (timeout) {
let delay = this.notification.delay || 1500; let delay = this.notification.delay || 1500;
delay += this.$store.state.notificationStore.length * 1000; delay += this.$store.state.notificationStore.length * 1000;