diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js index bc29d3f6a..1af3e6e4c 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, - chatUserId: this.user.id, + recipient_id: this.user.id, }, }) }, diff --git a/src/components/avatar_list/avatar_list.js b/src/components/avatar_list/avatar_list.js index 7c0a39ffd..7806fba81 100644 --- a/src/components/avatar_list/avatar_list.js +++ b/src/components/avatar_list/avatar_list.js @@ -1,19 +1,14 @@ 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: { - userIds: Set, - }, + props: ['users'], computed: { slicedUsers() { - return [...(this.userIds ?? [])] - .slice(0, 15) - .map((id) => useUsersStore().findUser(id)) + return this.users ? this.users.slice(0, 15) : [] }, }, components: { diff --git a/src/components/basic_user_card/basic_user_card.vue b/src/components/basic_user_card/basic_user_card.vue index 83b975f62..8946e4cb1 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 4f015db6a..1e26d24fb 100644 --- a/src/components/chat_new/chat_new.js +++ b/src/components/chat_new/chat_new.js @@ -4,7 +4,6 @@ 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' @@ -51,7 +50,7 @@ const chatNew = { this.$emit('cancel') }, goToChat(user) { - this.$router.push({ name: 'chat', params: { chatUserId: user.id } }) + this.$router.push({ name: 'chat', params: { recipient_id: user.id } }) }, onInput() { this.search(this.query) @@ -72,7 +71,7 @@ const chatNew = { this.loading = true this.userIds = [] this.$store - useSearchStore() + this.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 a0abcb5fe..75ab21dd5 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.idempotency_key]) { - delete this.pendingMessagesIndex[message.idempotency_key] + if (this.pendingMessagesIndex[message.idempotencyKeyIndex]) { + delete this.pendingMessagesIndex[message.idempotencyKeyIndex] 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 4eb29bcd6..8fd39aa1d 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -185,7 +185,6 @@ const conversation = { return [...conversation.keys()] .map((k) => useStatusesStore().allStatuses.get(k)) - .filter((status) => status.type != 'repeat') // Old backend behavior? .toSorted(sortById) }, statusMap() { @@ -622,7 +621,6 @@ 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 8ebbe9a2d..12072d7a2 100644 --- a/src/components/edit_status_modal/edit_status_modal.js +++ b/src/components/edit_status_modal/edit_status_modal.js @@ -1,5 +1,4 @@ import { get } from 'lodash' -import { mapState } from 'pinia' import { defineAsyncComponent } from 'vue' import Modal from 'src/components/modal/modal.vue' @@ -20,16 +19,18 @@ const EditStatusModal = { } }, computed: { + isLoggedIn() { + return !!useUsersStore().currentUser + }, modalActivated() { return useEditStatusStore().modalActivated }, isFormVisible() { - return this.loggedIn && !this.resettingForm && this.modalActivated + return this.isLoggedIn && !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 f9cc2e2fd..6296e3c9a 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.set(reaction.name, new Set(reaction.account_ids)) + acc[reaction.name] = reaction.accounts || [] 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 8f830e8ae..a8100c0d4 100644 --- a/src/components/emoji_reactions/emoji_reactions.vue +++ b/src/components/emoji_reactions/emoji_reactions.vue @@ -52,7 +52,7 @@