mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
Reset chat options when change guild routes (#9743)
This commit is contained in:
@@ -57,10 +57,19 @@ export default {
|
|||||||
this.currentSearchPosition = newText.length - 1;
|
this.currentSearchPosition = newText.length - 1;
|
||||||
},
|
},
|
||||||
chat () {
|
chat () {
|
||||||
|
this.resetDefaults();
|
||||||
this.grabUserNames();
|
this.grabUserNames();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
resetDefaults () {
|
||||||
|
// Mounted is not called when switching between group pages because they have the
|
||||||
|
// the same parent component. So, reset the data
|
||||||
|
this.currentSearch = '';
|
||||||
|
this.searchActive = false;
|
||||||
|
this.currentSearchPosition = 0;
|
||||||
|
this.tmpSelections = [];
|
||||||
|
},
|
||||||
grabUserNames () {
|
grabUserNames () {
|
||||||
let usersThatMessage = groupBy(this.chat, 'user');
|
let usersThatMessage = groupBy(this.chat, 'user');
|
||||||
for (let userName in usersThatMessage) {
|
for (let userName in usersThatMessage) {
|
||||||
|
|||||||
@@ -439,6 +439,14 @@ export default {
|
|||||||
},
|
},
|
||||||
beforeRouteUpdate (to, from, next) {
|
beforeRouteUpdate (to, from, next) {
|
||||||
this.$set(this, 'searchId', to.params.groupId);
|
this.$set(this, 'searchId', to.params.groupId);
|
||||||
|
|
||||||
|
// Reset chat
|
||||||
|
this.newMessage = '';
|
||||||
|
this.coords = {
|
||||||
|
TOP: 0,
|
||||||
|
LEFT: 0,
|
||||||
|
};
|
||||||
|
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
Reference in New Issue
Block a user