mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-03 00:09:41 +00: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:
parent
59af4a2d3b
commit
5e60a05cac
2 changed files with 9 additions and 3 deletions
|
|
@ -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');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue