Skip to content

Commit

Permalink
make buildWritingUsersSubtitleInfo() pure
Browse files Browse the repository at this point in the history
  • Loading branch information
nkonev committed Jan 24, 2025
1 parent e3890d6 commit beb79f0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions frontend/src/ChatView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -602,12 +602,10 @@ export default {
this.writingUsers.push({timestamp: +new Date(), login: data.login})
}
this.buildWritingUsersSubtitleInfo();
this.chatStore.usersWritingSubtitleInfo = this.buildWritingUsersSubtitleInfo(this.writingUsers);
},
buildWritingUsersSubtitleInfo() {
if (this.writingUsers.length) {
this.chatStore.usersWritingSubtitleInfo = this.writingUsers.map(v => v.login).join(', ') + " " + this.$vuetify.locale.t('$vuetify.user_is_writing');
}
buildWritingUsersSubtitleInfo(writingUsers) {
return writingUsers.map(v => v.login).join(', ') + " " + this.$vuetify.locale.t('$vuetify.user_is_writing');
},
onUserBroadcast(dto) {
console.log("onUserBroadcast", dto);
Expand Down Expand Up @@ -966,7 +964,7 @@ export default {
if (this.writingUsers.length == 0) {
this.chatStore.usersWritingSubtitleInfo = null;
} else {
this.buildWritingUsersSubtitleInfo();
this.chatStore.usersWritingSubtitleInfo = this.buildWritingUsersSubtitleInfo(this.writingUsers);
}
}, 500);
Expand Down

0 comments on commit beb79f0

Please sign in to comment.