mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Reload after rebirth (#11125)
* Add restart after rebirth Page will be reloaded after purchasing "Orb of Rebirth" * Remove restart after closing achievement This reload is not needed, as the page now reloads immediately after purchasing "Orb of Rebirth" * Move rebirth notification to modal * Delete references to rebirth notification
This commit is contained in:
committed by
Matteo Pagliazzi
parent
3f99c14a37
commit
5a15c73fca
@@ -1,5 +1,5 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
b-modal#rebirth(:title="$t('modalAchievement')", size='md', :hide-footer="true", @hidden="reloadPage()")
|
b-modal#rebirth(:title="$t('modalAchievement')", size='md', :hide-footer="true")
|
||||||
.modal-body
|
.modal-body
|
||||||
.col-12
|
.col-12
|
||||||
// @TODO: +achievementAvatar('sun',0)
|
// @TODO: +achievementAvatar('sun',0)
|
||||||
@@ -41,9 +41,6 @@
|
|||||||
close () {
|
close () {
|
||||||
this.$root.$emit('bv::hide::modal', 'rebirth');
|
this.$root.$emit('bv::hide::modal', 'rebirth');
|
||||||
},
|
},
|
||||||
reloadPage () {
|
|
||||||
window.location.reload(true);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -132,11 +132,6 @@ const NOTIFICATIONS = {
|
|||||||
label: ($t) => `${$t('achievement')}: ${$t('gearAchievementNotification')}`,
|
label: ($t) => `${$t('achievement')}: ${$t('gearAchievementNotification')}`,
|
||||||
modalId: 'ultimate-gear',
|
modalId: 'ultimate-gear',
|
||||||
},
|
},
|
||||||
REBIRTH_ACHIEVEMENT: {
|
|
||||||
label: ($t) => `${$t('achievement')}: ${$t('rebirthBegan')}`,
|
|
||||||
achievement: true,
|
|
||||||
modalId: 'rebirth',
|
|
||||||
},
|
|
||||||
GUILD_JOINED_ACHIEVEMENT: {
|
GUILD_JOINED_ACHIEVEMENT: {
|
||||||
label: ($t) => `${$t('achievement')}: ${$t('joinedGuild')}`,
|
label: ($t) => `${$t('achievement')}: ${$t('joinedGuild')}`,
|
||||||
achievement: true,
|
achievement: true,
|
||||||
@@ -360,18 +355,7 @@ export default {
|
|||||||
this.playSound(config.sound);
|
this.playSound(config.sound);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'REBIRTH_ACHIEVEMENT') {
|
if (forceToModal) {
|
||||||
// reload if the user hasn't clicked on the notification
|
|
||||||
const timeOut = setTimeout(() => {
|
|
||||||
window.location.reload(true);
|
|
||||||
}, 60000);
|
|
||||||
|
|
||||||
this.text(config.label(this.$t), () => {
|
|
||||||
// prevent the current reload timeout
|
|
||||||
clearTimeout(timeOut);
|
|
||||||
this.$root.$emit('bv::show::modal', config.modalId);
|
|
||||||
}, false);
|
|
||||||
} else if (forceToModal) {
|
|
||||||
this.$root.$emit('bv::show::modal', config.modalId);
|
this.$root.$emit('bv::show::modal', config.modalId);
|
||||||
} else {
|
} else {
|
||||||
this.text(config.label(this.$t), () => {
|
this.text(config.label(this.$t), () => {
|
||||||
@@ -573,8 +557,11 @@ export default {
|
|||||||
}, this.user.preferences.suppressModals.streak);
|
}, this.user.preferences.suppressModals.streak);
|
||||||
this.playSound('Achievement_Unlocked');
|
this.playSound('Achievement_Unlocked');
|
||||||
break;
|
break;
|
||||||
case 'ULTIMATE_GEAR_ACHIEVEMENT':
|
|
||||||
case 'REBIRTH_ACHIEVEMENT':
|
case 'REBIRTH_ACHIEVEMENT':
|
||||||
|
this.playSound('Achievement_Unlocked');
|
||||||
|
this.$root.$emit('bv::show::modal', 'rebirth');
|
||||||
|
break;
|
||||||
|
case 'ULTIMATE_GEAR_ACHIEVEMENT':
|
||||||
case 'GUILD_JOINED_ACHIEVEMENT':
|
case 'GUILD_JOINED_ACHIEVEMENT':
|
||||||
case 'CHALLENGE_JOINED_ACHIEVEMENT':
|
case 'CHALLENGE_JOINED_ACHIEVEMENT':
|
||||||
case 'INVITED_FRIEND_ACHIEVEMENT':
|
case 'INVITED_FRIEND_ACHIEVEMENT':
|
||||||
|
|||||||
@@ -397,6 +397,10 @@
|
|||||||
|
|
||||||
this.$emit('buyPressed', this.item);
|
this.$emit('buyPressed', this.item);
|
||||||
this.hideDialog();
|
this.hideDialog();
|
||||||
|
|
||||||
|
if (this.item.key === 'rebirth_orb') {
|
||||||
|
window.location.reload(true);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
purchaseGems () {
|
purchaseGems () {
|
||||||
if (this.item.key === 'rebirth_orb') {
|
if (this.item.key === 'rebirth_orb') {
|
||||||
|
|||||||
Reference in New Issue
Block a user