mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +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');
|
this.$root.$emit('bv::show::modal', 'close-challenge-modal');
|
||||||
},
|
},
|
||||||
edit () {
|
edit () {
|
||||||
// @TODO: set working challenge
|
this.$root.$emit('habitica:update-challenge', {
|
||||||
this.$store.state.challengeOptions.workingChallenge = Object.assign({}, this.$store.state.challengeOptions.workingChallenge, this.challenge);
|
challenge: this.challenge,
|
||||||
this.$root.$emit('bv::show::modal', 'challenge-modal');
|
});
|
||||||
},
|
},
|
||||||
// @TODO: view members
|
// @TODO: view members
|
||||||
updatedChallenge (eventData) {
|
updatedChallenge (eventData) {
|
||||||
|
|||||||
@@ -241,6 +241,12 @@ export default {
|
|||||||
this.$store.state.challengeOptions.workingChallenge = Object.assign({}, this.$store.state.challengeOptions.workingChallenge, data.challenge);
|
this.$store.state.challengeOptions.workingChallenge = Object.assign({}, this.$store.state.challengeOptions.workingChallenge, data.challenge);
|
||||||
this.$root.$emit('bv::show::modal', 'challenge-modal');
|
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 () {
|
beforeDestroy () {
|
||||||
this.$root.$off('habitica:clone-challenge');
|
this.$root.$off('habitica:clone-challenge');
|
||||||
|
|||||||
Reference in New Issue
Block a user