mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Added broken task event
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<template lang='pug'>
|
<template lang='pug'>
|
||||||
b-modal#broken-task-modal(title="Broken Challenge", size='sm', :hide-footer="true", v-if='brokenChallengeTask && brokenChallengeTask.challenge')
|
b-modal#broken-task-modal(title="Broken Challenge", size='sm', :hide-footer="true")
|
||||||
.modal-body
|
.modal-body(v-if='brokenChallengeTask && brokenChallengeTask.challenge')
|
||||||
div(v-if='brokenChallengeTask.challenge.broken === "TASK_DELETED" || brokenChallengeTask.challenge.broken === "CHALLENGE_TASK_NOT_FOUND"')
|
div(v-if='brokenChallengeTask.challenge.broken === "TASK_DELETED" || brokenChallengeTask.challenge.broken === "CHALLENGE_TASK_NOT_FOUND"')
|
||||||
h2 {{ $t('brokenTask') }}
|
h2 {{ $t('brokenTask') }}
|
||||||
div
|
div
|
||||||
@@ -41,10 +41,19 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
bModal,
|
bModal,
|
||||||
},
|
},
|
||||||
computed: {
|
data () {
|
||||||
brokenChallengeTask () {
|
return {
|
||||||
return this.$store.state.brokenChallengeTask;
|
brokenChallengeTask: {},
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
created () {
|
||||||
|
this.$root.$on('handle-broken-task', (task) => {
|
||||||
|
this.brokenChallengeTask = Object.assign({}, task);
|
||||||
|
this.$root.$emit('show::modal', 'broken-task-modal');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
removed () {
|
||||||
|
this.$root.$remove('handle-broken-task');
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions({
|
...mapActions({
|
||||||
|
|||||||
@@ -749,8 +749,7 @@ export default {
|
|||||||
},
|
},
|
||||||
handleBrokenTask (task) {
|
handleBrokenTask (task) {
|
||||||
if (this.$store.state.isRunningYesterdailies) return;
|
if (this.$store.state.isRunningYesterdailies) return;
|
||||||
this.$store.state.brokenChallengeTask = task;
|
this.$root.$emit('handle-broken-task', task);
|
||||||
this.$root.$emit('show::modal', 'broken-task-modal');
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user