fix old chats not working
This commit is contained in:
parent
ca4fa0da3e
commit
0482ec2da2
3 changed files with 20 additions and 5 deletions
|
|
@ -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,
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue