Refactored actions, 'cast a spell' task now works
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
<script lang="js">
|
||||
import doAction from '/imports/client/ui/creature/actions/doAction';
|
||||
import PropertyIcon from '/imports/client/ui/properties/shared/PropertyIcon.vue';
|
||||
import { snackbar } from '/imports/client/ui/components/snackbars/SnackbarQueue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -39,10 +40,22 @@ export default {
|
||||
},
|
||||
data(){return {
|
||||
hovering: false,
|
||||
loading: false,
|
||||
}},
|
||||
methods: {
|
||||
doAction() {
|
||||
doAction(this.model, this.$store, `event-btn-${this.model._id}`);
|
||||
async doAction() {
|
||||
this.loading = true;
|
||||
doAction({
|
||||
propId: this.model._id,
|
||||
creatureId: this.model.root.id,
|
||||
$store: this.$store,
|
||||
elementId: `event-btn-${this.model._id}`,
|
||||
}).catch(error => {
|
||||
snackbar({ text: error.reason || error.message || error.toString() });
|
||||
console.error(error);
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user