diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js index 1af3e6e4c..bc29d3f6a 100644 --- a/src/components/account_actions/account_actions.js +++ b/src/components/account_actions/account_actions.js @@ -90,7 +90,7 @@ const AccountActions = { name: 'chat', params: { username: useUsersStore().currentUser.screen_name, - recipient_id: this.user.id, + chatUserId: this.user.id, }, }) }, diff --git a/src/components/avatar_list/avatar_list.js b/src/components/avatar_list/avatar_list.js index 7806fba81..7c0a39ffd 100644 --- a/src/components/avatar_list/avatar_list.js +++ b/src/components/avatar_list/avatar_list.js @@ -1,14 +1,19 @@ import UserAvatar from 'src/components/user_avatar/user_avatar.vue' import { useInstanceStore } from 'src/stores/instance.js' +import { useUsersStore } from 'src/stores/users.js' import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' const AvatarList = { - props: ['users'], + props: { + userIds: Set, + }, computed: { slicedUsers() { - return this.users ? this.users.slice(0, 15) : [] + return [...(this.userIds ?? [])] + .slice(0, 15) + .map((id) => useUsersStore().findUser(id)) }, }, components: { diff --git a/src/components/basic_user_card/basic_user_card.vue b/src/components/basic_user_card/basic_user_card.vue index 8946e4cb1..83b975f62 100644 --- a/src/components/basic_user_card/basic_user_card.vue +++ b/src/components/basic_user_card/basic_user_card.vue @@ -41,7 +41,7 @@ {{ $t('admin_dash.users.labels.handle_colon') }} {{ ' ' }} - diff --git a/src/components/chat_new/chat_new.js b/src/components/chat_new/chat_new.js index 1e26d24fb..4f015db6a 100644 --- a/src/components/chat_new/chat_new.js +++ b/src/components/chat_new/chat_new.js @@ -4,6 +4,7 @@ import BasicUserCard from 'src/components/basic_user_card/basic_user_card.vue' import UserAvatar from 'src/components/user_avatar/user_avatar.vue' import { useOAuthStore } from 'src/stores/oauth.js' +import { useSearchStore } from 'src/stores/search.js' import { useUsersStore } from 'src/stores/users.js' import { chats } from 'src/api/chats.js' @@ -50,7 +51,7 @@ const chatNew = { this.$emit('cancel') }, goToChat(user) { - this.$router.push({ name: 'chat', params: { recipient_id: user.id } }) + this.$router.push({ name: 'chat', params: { chatUserId: user.id } }) }, onInput() { this.search(this.query) @@ -71,7 +72,7 @@ const chatNew = { this.loading = true this.userIds = [] this.$store - this.useSearchStore() + useSearchStore() .search({ q: query, resolve: true, type: 'accounts' }) .then((data) => { this.loading = false diff --git a/src/components/chat_view/chat_view.js b/src/components/chat_view/chat_view.js index 75ab21dd5..a0abcb5fe 100644 --- a/src/components/chat_view/chat_view.js +++ b/src/components/chat_view/chat_view.js @@ -472,8 +472,8 @@ const Chat = { // Clear any known pending messages if (message.idempotency_key) { - if (this.pendingMessagesIndex[message.idempotencyKeyIndex]) { - delete this.pendingMessagesIndex[message.idempotencyKeyIndex] + if (this.pendingMessagesIndex[message.idempotency_key]) { + delete this.pendingMessagesIndex[message.idempotency_key] this.pendingMessages = this.pendingMessages.filter( ({ idempotency_key }) => idempotency_key !== message.idempotency_key, diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 8fd39aa1d..4eb29bcd6 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -185,6 +185,7 @@ const conversation = { return [...conversation.keys()] .map((k) => useStatusesStore().allStatuses.get(k)) + .filter((status) => status.type != 'repeat') // Old backend behavior? .toSorted(sortById) }, statusMap() { @@ -621,6 +622,7 @@ const conversation = { }, updateVirtualHeight() { if (this.hide) return // no updates when not rendering + if (!this.status) return // not loaded yet this.$nextTick(() => { this.virtualHeight = this.$refs.body.getBoundingClientRect().height this.$emit('update:virtualHeight', { diff --git a/src/components/edit_status_modal/edit_status_modal.js b/src/components/edit_status_modal/edit_status_modal.js index 12072d7a2..8ebbe9a2d 100644 --- a/src/components/edit_status_modal/edit_status_modal.js +++ b/src/components/edit_status_modal/edit_status_modal.js @@ -1,4 +1,5 @@ import { get } from 'lodash' +import { mapState } from 'pinia' import { defineAsyncComponent } from 'vue' import Modal from 'src/components/modal/modal.vue' @@ -19,18 +20,16 @@ const EditStatusModal = { } }, computed: { - isLoggedIn() { - return !!useUsersStore().currentUser - }, modalActivated() { return useEditStatusStore().modalActivated }, isFormVisible() { - return this.isLoggedIn && !this.resettingForm && this.modalActivated + return this.loggedIn && !this.resettingForm && this.modalActivated }, params() { return useEditStatusStore().params || {} }, + ...mapState(useUsersStore, ['loggedIn']), }, watch: { params(newVal, oldVal) { diff --git a/src/components/emoji_reactions/emoji_reactions.js b/src/components/emoji_reactions/emoji_reactions.js index 6296e3c9a..f9cc2e2fd 100644 --- a/src/components/emoji_reactions/emoji_reactions.js +++ b/src/components/emoji_reactions/emoji_reactions.js @@ -37,9 +37,9 @@ const EmojiReactions = { }, accountsForEmoji() { return this.status.emoji_reactions.reduce((acc, reaction) => { - acc[reaction.name] = reaction.accounts || [] + acc.set(reaction.name, new Set(reaction.account_ids)) return acc - }, {}) + }, new Map()) }, loggedIn() { return !!useUsersStore().currentUser diff --git a/src/components/emoji_reactions/emoji_reactions.vue b/src/components/emoji_reactions/emoji_reactions.vue index a8100c0d4..8f830e8ae 100644 --- a/src/components/emoji_reactions/emoji_reactions.vue +++ b/src/components/emoji_reactions/emoji_reactions.vue @@ -52,7 +52,7 @@