mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
13046 - Fix creating challenge after cloning (#13048)
This commit is contained in:
@@ -459,9 +459,16 @@ export default {
|
|||||||
};
|
};
|
||||||
this.$root.$emit('bv::show::modal', 'challenge-modal');
|
this.$root.$emit('bv::show::modal', 'challenge-modal');
|
||||||
});
|
});
|
||||||
|
this.$root.$on('habitica:create-challenge', () => {
|
||||||
|
this.cloning = false;
|
||||||
|
this.$store.state.challengeOptions.workingChallenge = {};
|
||||||
|
this.$root.$emit('bv::show::modal', 'challenge-modal');
|
||||||
|
});
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
this.$root.$off('habitica:clone-challenge');
|
this.$root.$off('habitica:clone-challenge');
|
||||||
|
this.$root.$off('habitica:update-challenge');
|
||||||
|
this.$root.$off('habitica:create-challenge');
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async shown () {
|
async shown () {
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ export default {
|
|||||||
this.loadChallenges();
|
this.loadChallenges();
|
||||||
},
|
},
|
||||||
createChallenge () {
|
createChallenge () {
|
||||||
this.$root.$emit('bv::show::modal', 'challenge-modal');
|
this.$root.$emit('habitica:create-challenge');
|
||||||
},
|
},
|
||||||
async loadChallenges () {
|
async loadChallenges () {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ export default {
|
|||||||
this.challenges = await this.$store.dispatch('challenges:getGroupChallenges', { groupId: this.groupIdForChallenges });
|
this.challenges = await this.$store.dispatch('challenges:getGroupChallenges', { groupId: this.groupIdForChallenges });
|
||||||
},
|
},
|
||||||
createChallenge () {
|
createChallenge () {
|
||||||
this.$root.$emit('bv::show::modal', 'challenge-modal');
|
this.$root.$emit('habitica:create-challenge');
|
||||||
},
|
},
|
||||||
challengeCreated (challenge) {
|
challengeCreated (challenge) {
|
||||||
if (challenge.group._id !== this.groupIdForChallenges) return;
|
if (challenge.group._id !== this.groupIdForChallenges) return;
|
||||||
|
|||||||
@@ -236,8 +236,7 @@ export default {
|
|||||||
this.loadChallenges();
|
this.loadChallenges();
|
||||||
},
|
},
|
||||||
createChallenge () {
|
createChallenge () {
|
||||||
this.$store.state.challengeOptions.workingChallenge = {};
|
this.$root.$emit('habitica:create-challenge');
|
||||||
this.$root.$emit('bv::show::modal', 'challenge-modal');
|
|
||||||
},
|
},
|
||||||
async loadChallenges () {
|
async loadChallenges () {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user