Refactored duplicate card section (#9730)

* Refactored duplicate card section

* Updated to new computed methods
This commit is contained in:
Keith Holliday
2017-12-20 12:27:21 -06:00
committed by GitHub
parent 6e0b6171c6
commit afc1ffd90b
4 changed files with 319 additions and 288 deletions

View File

@@ -33,12 +33,6 @@ export default {
name: `<span class='text-danger'>${reportMessage}</span>`,
};
},
abuseObject () {
return this.$store.state.flagChatOptions.message;
},
groupId () {
return this.$store.state.flagChatOptions.groupId;
},
},
data () {
let abuseFlagModalBody = {
@@ -49,8 +43,21 @@ export default {
return {
abuseFlagModalBody,
abuseObject: '',
groupId: '',
};
},
created () {
this.$root.$on('habitica::report-chat', data => {
if (!data.message || !data.groupId) return;
this.abuseObject = data.message;
this.groupId = data.groupId;
this.$root.$emit('bv::show::modal', 'report-flag');
});
},
destroyed () {
this.$root.$off('habitica::report-chat');
},
methods: {
close () {
this.$root.$emit('bv::hide::modal', 'report-flag');