Correct some modal repops (#11739)

* fix(modals): correct some repops

* fix(modals): also clean out "prev"

* refactor(modals): hide in dismiss event
This commit is contained in:
Sabe Jones
2020-01-24 16:36:11 -06:00
committed by GitHub
parent b9d3d7f87a
commit aefd664db1
4 changed files with 25 additions and 4 deletions

View File

@@ -144,14 +144,16 @@ export default {
challengeId: this.challengeId,
winnerId: this.winner._id,
});
this.$root.$emit('habitica::dismiss-modal', 'close-challenge-modal');
this.$router.push('/challenges/myChallenges');
},
async deleteChallenge () {
if (!window.confirm('Are you sure you want to delete this challenge?')) return;
if (!window.confirm(this.$t('sureDelCha'))) return;
this.challenge = await this.$store.dispatch('challenges:deleteChallenge', {
challengeId: this.challengeId,
prize: this.prize,
});
this.$root.$emit('habitica::dismiss-modal', 'close-challenge-modal');
this.$router.push('/challenges/myChallenges');
},
},