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([
{
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,
},
{

View file

@ -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])

View file

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