mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Client fixes aug 31 (#9010)
* Separated private message model * Added markdown to profile * Add color backgrounds * Added broken challenge flow * Added summary field to getgroups * Fixed group form information loading * Updated autocomplete to use chat * Fixed npc styles * Fixed onload mentions
This commit is contained in:
@@ -14,7 +14,7 @@ div.autocomplete-selection(v-if='searchResults.length > 0', :style='autocomplete
|
||||
import groupBy from 'lodash/groupBy';
|
||||
|
||||
export default {
|
||||
props: ['selections', 'text', 'coords', 'groupId', 'chat'],
|
||||
props: ['selections', 'text', 'coords', 'chat'],
|
||||
data () {
|
||||
return {
|
||||
currentSearch: '',
|
||||
@@ -43,6 +43,9 @@ export default {
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
this.grabUserNames();
|
||||
},
|
||||
watch: {
|
||||
text (newText) {
|
||||
if (newText[newText.length - 1] !== '@') return;
|
||||
@@ -50,22 +53,19 @@ export default {
|
||||
this.currentSearchPosition = newText.length - 1;
|
||||
},
|
||||
chat () {
|
||||
this.grabUserNames();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
grabUserNames () {
|
||||
let usersThatMessage = groupBy(this.chat, 'user');
|
||||
for (let userName in usersThatMessage) {
|
||||
if (this.tmpSelections.indexOf(userName) === -1) {
|
||||
let systemMessage = userName === 'undefined';
|
||||
if (!systemMessage && this.tmpSelections.indexOf(userName) === -1) {
|
||||
this.tmpSelections.push(userName);
|
||||
}
|
||||
}
|
||||
},
|
||||
async groupId () {
|
||||
if (!this.groupId) return;
|
||||
let members = await this.$store.dispatch('members:getGroupMembers', {groupId: this.groupId});
|
||||
this.tmpSelections = members.map((member) => {
|
||||
return member.profile.name;
|
||||
});
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
select (result) {
|
||||
let newText = this.text.slice(0, this.currentSearchPosition + 1) + result;
|
||||
this.searchActive = false;
|
||||
|
||||
Reference in New Issue
Block a user