mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Achievements Fixes (#11540)
* achievements fixes to timeout and modal * fix string
This commit is contained in:
@@ -184,11 +184,19 @@ const NOTIFICATIONS = {
|
||||
achievement: true,
|
||||
label: $t => `${$t('achievement')}: ${$t('achievementPartyUp')}`,
|
||||
modalId: 'generic-achievement',
|
||||
data: {
|
||||
message: $t => $t('achievement'),
|
||||
modalText: $t => $t('achievementPartyUp'),
|
||||
},
|
||||
},
|
||||
ACHIEVEMENT_PARTY_ON: {
|
||||
achievement: true,
|
||||
label: $t => `${$t('achievement')}: ${$t('achievementPartyOn')}`,
|
||||
modalId: 'generic-achievement',
|
||||
data: {
|
||||
message: $t => $t('achievement'),
|
||||
modalText: $t => $t('achievementPartyOn'),
|
||||
},
|
||||
},
|
||||
ACHIEVEMENT_BEAST_MASTER: {
|
||||
achievement: true,
|
||||
@@ -196,7 +204,7 @@ const NOTIFICATIONS = {
|
||||
modalId: 'generic-achievement',
|
||||
data: {
|
||||
message: $t => $t('achievement'),
|
||||
modalText: $t => $t('mountAchievement'),
|
||||
modalText: $t => $t('beastAchievement'),
|
||||
},
|
||||
},
|
||||
ACHIEVEMENT_MOUNT_MASTER: {
|
||||
@@ -445,10 +453,10 @@ export default {
|
||||
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);
|
||||
}
|
||||
if (!data.message && config.data.message) {
|
||||
if (!data.message && config && config.data && config.data.message) {
|
||||
data.message = config.data.message(this.$t);
|
||||
}
|
||||
|
||||
|
||||
@@ -215,8 +215,12 @@ export default {
|
||||
},
|
||||
},
|
||||
created () {
|
||||
const timeout = this.notification && this.notification.timeout
|
||||
? this.notification.timeout : true;
|
||||
const timeout = (
|
||||
this.notification
|
||||
&& this.notification.timeout !== undefined
|
||||
&& this.notification.timeout !== null
|
||||
) ? this.notification.timeout : true;
|
||||
|
||||
if (timeout) {
|
||||
let delay = this.notification.delay || 1500;
|
||||
delay += this.$store.state.notificationStore.length * 1000;
|
||||
|
||||
Reference in New Issue
Block a user