From 47770ed7151ad0ba1cd8b77eb52590edd9ce9737 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Wed, 17 Feb 2021 10:16:58 +0200 Subject: get rid of older messages when scrolling down in chat to keep it from bloating dom --- src/components/chat/chat.js | 1 + 1 file changed, 1 insertion(+) (limited to 'src/components/chat/chat.js') diff --git a/src/components/chat/chat.js b/src/components/chat/chat.js index e57fcb91..f446f25b 100644 --- a/src/components/chat/chat.js +++ b/src/components/chat/chat.js @@ -241,6 +241,7 @@ const Chat = { this.fetchChat({ maxId: this.currentChatMessageService.minId }) } else if (this.bottomedOut(JUMP_TO_BOTTOM_BUTTON_VISIBILITY_OFFSET)) { this.jumpToBottomButtonVisible = false + this.$store.dispatch('cullOlderMessages', this.currentChatMessageService.chatId) if (this.newMessageCount > 0) { // Use a delay before marking as read to prevent situation where new messages // arrive just as you're leaving the view and messages that you didn't actually -- cgit v1.2.3-70-g09d2 From 67f3532ac95b2a8740ccbde581e74ac65eb20a9a Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Thu, 18 Feb 2021 10:14:45 +0200 Subject: add additional check with timeout --- src/components/chat/chat.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/components/chat/chat.js') diff --git a/src/components/chat/chat.js b/src/components/chat/chat.js index f446f25b..2780be75 100644 --- a/src/components/chat/chat.js +++ b/src/components/chat/chat.js @@ -234,6 +234,13 @@ const Chat = { const scrollable = this.$refs.scrollable return scrollable && scrollable.scrollTop <= 0 }, + cullOlderCheck () { + window.setTimeout(() => { + if (this.bottomedOut(JUMP_TO_BOTTOM_BUTTON_VISIBILITY_OFFSET)) { + this.$store.dispatch('cullOlderMessages', this.currentChatMessageService.chatId) + } + }, 5000) + }, handleScroll: _.throttle(function () { if (!this.currentChat) { return } @@ -241,7 +248,7 @@ const Chat = { this.fetchChat({ maxId: this.currentChatMessageService.minId }) } else if (this.bottomedOut(JUMP_TO_BOTTOM_BUTTON_VISIBILITY_OFFSET)) { this.jumpToBottomButtonVisible = false - this.$store.dispatch('cullOlderMessages', this.currentChatMessageService.chatId) + this.cullOlderCheck() if (this.newMessageCount > 0) { // Use a delay before marking as read to prevent situation where new messages // arrive just as you're leaving the view and messages that you didn't actually -- cgit v1.2.3-70-g09d2 From 09fe160e8b9fad7a8c70e44ae894d67211b993e1 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Fri, 26 Feb 2021 16:23:11 +0200 Subject: separate screen_name and screen_name_ui with decoded punycode --- CHANGELOG.md | 1 + src/components/basic_user_card/basic_user_card.vue | 2 +- src/components/chat/chat.js | 2 +- src/components/chat_title/chat_title.js | 2 +- src/components/emoji_input/suggestor.js | 4 ++-- src/components/notification/notification.vue | 10 +++++----- src/components/status/status.js | 4 ++-- src/components/status/status.vue | 6 +++--- src/components/user_avatar/user_avatar.vue | 4 ++-- src/components/user_card/user_card.vue | 4 ++-- src/components/user_list_popover/user_list_popover.vue | 2 +- src/components/user_reporting_modal/user_reporting_modal.vue | 2 +- src/services/entity_normalizer/entity_normalizer.service.js | 5 +++-- .../specs/services/entity_normalizer/entity_normalizer.spec.js | 2 +- 14 files changed, 26 insertions(+), 24 deletions(-) (limited to 'src/components/chat/chat.js') diff --git a/CHANGELOG.md b/CHANGELOG.md index 2685fd32..20d96f98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fixed missing highlighted border in expanded conversations again - Fixed some UI jumpiness when opening images particularly in chat view - Fixed chat unread badge looking weird +- Fixed punycode names not working properly ### Changed - Display 'people voted' instead of 'votes' for multi-choice polls diff --git a/src/components/basic_user_card/basic_user_card.vue b/src/components/basic_user_card/basic_user_card.vue index 9e410610..c53f6a9c 100644 --- a/src/components/basic_user_card/basic_user_card.vue +++ b/src/components/basic_user_card/basic_user_card.vue @@ -42,7 +42,7 @@ class="basic-user-card-screen-name" :to="userProfileLink(user)" > - @{{ user.screen_name }} + @{{ user.screen_name_ui }} diff --git a/src/components/chat/chat.js b/src/components/chat/chat.js index 2780be75..b54f5fb2 100644 --- a/src/components/chat/chat.js +++ b/src/components/chat/chat.js @@ -73,7 +73,7 @@ const Chat = { }, formPlaceholder () { if (this.recipient) { - return this.$t('chats.message_user', { nickname: this.recipient.screen_name }) + return this.$t('chats.message_user', { nickname: this.recipient.screen_name_ui }) } else { return '' } diff --git a/src/components/chat_title/chat_title.js b/src/components/chat_title/chat_title.js index e424bb1f..edfbe7a4 100644 --- a/src/components/chat_title/chat_title.js +++ b/src/components/chat_title/chat_title.js @@ -12,7 +12,7 @@ export default Vue.component('chat-title', { ], computed: { title () { - return this.user ? this.user.screen_name : '' + return this.user ? this.user.screen_name_ui : '' }, htmlTitle () { return this.user ? this.user.name_html : '' diff --git a/src/components/emoji_input/suggestor.js b/src/components/emoji_input/suggestor.js index 14a2b41e..e8efbd1e 100644 --- a/src/components/emoji_input/suggestor.js +++ b/src/components/emoji_input/suggestor.js @@ -116,8 +116,8 @@ export const suggestUsers = ({ dispatch, state }) => { return diff + nameAlphabetically + screenNameAlphabetically /* eslint-disable camelcase */ - }).map(({ screen_name, name, profile_image_url_original }) => ({ - displayText: screen_name, + }).map(({ screen_name, screen_name_ui, name, profile_image_url_original }) => ({ + displayText: screen_name_ui, detailText: name, imageUrl: profile_image_url_original, replacement: '@' + screen_name + ' ' diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index f56aa977..0081dee4 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -11,7 +11,7 @@ > - {{ notification.from_profile.screen_name }} + {{ notification.from_profile.screen_name_ui }}