mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
unsubscribe events for a specific method (#10652)
This commit is contained in:
@@ -96,16 +96,10 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this.$root.$on('habitica::report-chat', data => {
|
this.$root.$on('habitica::report-chat', this.handleReport);
|
||||||
if (!data.message || !data.groupId) return;
|
|
||||||
this.abuseObject = data.message;
|
|
||||||
this.groupId = data.groupId;
|
|
||||||
this.reportComment = '';
|
|
||||||
this.$root.$emit('bv::show::modal', 'report-flag');
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
destroyed () {
|
destroyed () {
|
||||||
this.$root.$off('habitica::report-chat');
|
this.$root.$off('habitica::report-chat', this.handleReport);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
close () {
|
close () {
|
||||||
@@ -129,6 +123,13 @@ export default {
|
|||||||
});
|
});
|
||||||
this.close();
|
this.close();
|
||||||
},
|
},
|
||||||
|
handleReport (data) {
|
||||||
|
if (!data.message || !data.groupId) return;
|
||||||
|
this.abuseObject = data.message;
|
||||||
|
this.groupId = data.groupId;
|
||||||
|
this.reportComment = '';
|
||||||
|
this.$root.$emit('bv::show::modal', 'report-flag');
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user