diff --git a/src/boot/routes.js b/src/boot/routes.js index 1371b14da..5897fad92 100644 --- a/src/boot/routes.js +++ b/src/boot/routes.js @@ -251,9 +251,10 @@ export default (store) => { routes = routes.concat([ { name: 'chat', - path: '/users/:username/chats/:recipient_id', + path: '/users/:username/chats/:chatUserId', component: () => import('src/components/chat_view/chat_view.vue'), meta: { dontScroll: false }, + props: true, beforeEnter: validateAuthenticatedRoute, }, { diff --git a/src/components/chat_view/chat_view.js b/src/components/chat_view/chat_view.js index f2b5618ed..07866ad2e 100644 --- a/src/components/chat_view/chat_view.js +++ b/src/components/chat_view/chat_view.js @@ -53,7 +53,14 @@ const Chat = { PostStatusForm, }, props: { - statusId: String, + statusId: { + type: String, + default: null, + }, + chatUserId: { + type: String, + default: null, + }, testMode: Boolean, }, data() { @@ -348,17 +355,21 @@ const Chat = { // full height of the scrollable container. // If this is the case, we want to fetch the messages until the scrollable container // is fully populated so that the user has the ability to scroll up and load the history. - if (!isScrollable() && messages.length > 0) { + // + // Conversation fetching doesn't support pagination and spews out everything at once + // so we both can't and don't need to fetch previous posts + if (!this.isConversation && !isScrollable() && messages.length > 0) { this.fetchChat({ maxId: this.minId, }) } }, async startFetching() { + console.log(this.statusId, this.chatUserId) if (!this.isConversation) { try { const { data } = await getOrCreateChat({ - accountId: this.recipientId, + accountId: this.chatUserId, credentials: useOAuthStore().token, }) this.$store.commit('addNewUsers', [data.account]) diff --git a/src/components/chat_view/chat_view.vue b/src/components/chat_view/chat_view.vue index 5ea2fd2b5..f0a40ebc6 100644 --- a/src/components/chat_view/chat_view.vue +++ b/src/components/chat_view/chat_view.vue @@ -67,7 +67,10 @@ -
+
{{ explicitReplyStatus ? $t('status.reply_to_selected') : $t('status.reply_to_last') }}