Skip to content

Commit

Permalink
Reload after rebirth (#11125)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
HydeHunter2 authored and paglias committed Apr 27, 2019
1 parent 3f99c14 commit 5a15c73
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 22 deletions.
5 changes: 1 addition & 4 deletions website/client/components/achievements/rebirth.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<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
.col-12
// @TODO: +achievementAvatar('sun',0)
Expand Down Expand Up @@ -41,9 +41,6 @@
close () {
this.$root.$emit('bv::hide::modal', 'rebirth');
},
reloadPage () {
window.location.reload(true);
},
},
};
</script>
23 changes: 5 additions & 18 deletions website/client/components/notifications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@ const NOTIFICATIONS = {
label: ($t) => `${$t('achievement')}: ${$t('gearAchievementNotification')}`,
modalId: 'ultimate-gear',
},
REBIRTH_ACHIEVEMENT: {
label: ($t) => `${$t('achievement')}: ${$t('rebirthBegan')}`,
achievement: true,
modalId: 'rebirth',
},
GUILD_JOINED_ACHIEVEMENT: {
label: ($t) => `${$t('achievement')}: ${$t('joinedGuild')}`,
achievement: true,
Expand Down Expand Up @@ -360,18 +355,7 @@ export default {
this.playSound(config.sound);
}
if (type === 'REBIRTH_ACHIEVEMENT') {
// 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) {
if (forceToModal) {
this.$root.$emit('bv::show::modal', config.modalId);
} else {
this.text(config.label(this.$t), () => {
Expand Down Expand Up @@ -573,8 +557,11 @@ export default {
}, this.user.preferences.suppressModals.streak);
this.playSound('Achievement_Unlocked');
break;
case 'ULTIMATE_GEAR_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 'CHALLENGE_JOINED_ACHIEVEMENT':
case 'INVITED_FRIEND_ACHIEVEMENT':
Expand Down
4 changes: 4 additions & 0 deletions website/client/components/shops/buyModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,10 @@
this.$emit('buyPressed', this.item);
this.hideDialog();
if (this.item.key === 'rebirth_orb') {
window.location.reload(true);
}
},
purchaseGems () {
if (this.item.key === 'rebirth_orb') {
Expand Down

0 comments on commit 5a15c73

Please sign in to comment.