mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Refactored duplicate card section (#9730)
* Refactored duplicate card section * Updated to new computed methods
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user