mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +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,
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user