mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
related to 10419 (#10438)
Added a 'habitica:update-challenge' call to mirror the 'clone-challenge' call. This properly sets the 'cloning' flag and makes things more consistent. This fixes the a bug related to #10419 described in the #10419 thread
This commit is contained in:
committed by
Matteo Pagliazzi
parent
59af4a2d3b
commit
5e60a05cac
@@ -365,9 +365,9 @@ export default {
|
||||
this.$root.$emit('bv::show::modal', 'close-challenge-modal');
|
||||
},
|
||||
edit () {
|
||||
// @TODO: set working challenge
|
||||
this.$store.state.challengeOptions.workingChallenge = Object.assign({}, this.$store.state.challengeOptions.workingChallenge, this.challenge);
|
||||
this.$root.$emit('bv::show::modal', 'challenge-modal');
|
||||
this.$root.$emit('habitica:update-challenge', {
|
||||
challenge: this.challenge,
|
||||
});
|
||||
},
|
||||
// @TODO: view members
|
||||
updatedChallenge (eventData) {
|
||||
|
||||
@@ -241,6 +241,12 @@ export default {
|
||||
this.$store.state.challengeOptions.workingChallenge = Object.assign({}, this.$store.state.challengeOptions.workingChallenge, data.challenge);
|
||||
this.$root.$emit('bv::show::modal', 'challenge-modal');
|
||||
});
|
||||
this.$root.$on('habitica:update-challenge', (data) => {
|
||||
if (!data.challenge) return;
|
||||
this.cloning = false;
|
||||
this.$store.state.challengeOptions.workingChallenge = Object.assign({}, this.$store.state.challengeOptions.workingChallenge, data.challenge);
|
||||
this.$root.$emit('bv::show::modal', 'challenge-modal');
|
||||
});
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.$root.$off('habitica:clone-challenge');
|
||||
|
||||
Reference in New Issue
Block a user