fix old chats not working

This commit is contained in:
Henry Jameson 2026-07-30 15:13:21 +03:00
commit 0482ec2da2
3 changed files with 20 additions and 5 deletions

View file

@ -251,9 +251,10 @@ export default (store) => {
routes = routes.concat([ routes = routes.concat([
{ {
name: 'chat', name: 'chat',
path: '/users/:username/chats/:recipient_id', path: '/users/:username/chats/:chatUserId',
component: () => import('src/components/chat_view/chat_view.vue'), component: () => import('src/components/chat_view/chat_view.vue'),
meta: { dontScroll: false }, meta: { dontScroll: false },
props: true,
beforeEnter: validateAuthenticatedRoute, beforeEnter: validateAuthenticatedRoute,
}, },
{ {

View file

@ -53,7 +53,14 @@ const Chat = {
PostStatusForm, PostStatusForm,
}, },
props: { props: {
statusId: String, statusId: {
type: String,
default: null,
},
chatUserId: {
type: String,
default: null,
},
testMode: Boolean, testMode: Boolean,
}, },
data() { data() {
@ -348,17 +355,21 @@ const Chat = {
// full height of the scrollable container. // full height of the scrollable container.
// If this is the case, we want to fetch the messages until 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. // 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({ this.fetchChat({
maxId: this.minId, maxId: this.minId,
}) })
} }
}, },
async startFetching() { async startFetching() {
console.log(this.statusId, this.chatUserId)
if (!this.isConversation) { if (!this.isConversation) {
try { try {
const { data } = await getOrCreateChat({ const { data } = await getOrCreateChat({
accountId: this.recipientId, accountId: this.chatUserId,
credentials: useOAuthStore().token, credentials: useOAuthStore().token,
}) })
this.$store.commit('addNewUsers', [data.account]) this.$store.commit('addNewUsers', [data.account])

View file

@ -67,7 +67,10 @@
</div> </div>
</span> </span>
</div> </div>
<div class="auto-reply-to-section"> <div
v-if="isConversation"
class="auto-reply-to-section"
>
<div class="reply-to-text"> <div class="reply-to-text">
{{ explicitReplyStatus ? $t('status.reply_to_selected') : $t('status.reply_to_last') }} {{ explicitReplyStatus ? $t('status.reply_to_selected') : $t('status.reply_to_last') }}
<button <button