Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spinner still there even when setting messages-loaded to true #485

Open
bacca-chew opened this issue Nov 14, 2023 · 1 comment
Open

Spinner still there even when setting messages-loaded to true #485

bacca-chew opened this issue Nov 14, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@bacca-chew
Copy link

Describe the bug

The UI doesn't display the messages. Instead, it shows a loading spinner.

Steps to reproduce

I used the code snippits provided in the documentation. Here's the code I tried:

<template>
  <vue-advanced-chat :current-user-id="currentUserId" room-id="1" rooms-loaded="true" messages-loaded="true" :rooms="JSON.stringify(rooms)" :messages="JSON.stringify(messages)"
    :room-actions="JSON.stringify(roomActions)" />
</template>

<script>
import { register } from 'vue-advanced-chat'
register()

export default {
  data() {
    return {
      currentUserId: '1234',
      rooms: [
        {
          roomId: '1',
          roomName: 'Room 1',
          unreadCount: 4,
          index: 3,
          lastMessage: {
            _id: 'xyz',
            content: 'Last message received',
            senderId: '1234',
            username: 'John Doe',
            timestamp: '10:20',
            saved: true,
            distributed: false,
            seen: false,
            new: true
          },
          users: [
            {
              _id: '1234',
              username: 'John Doe',
              status: {
                state: 'online',
                lastChanged: 'today, 14:30'
              }
            },
            {
              _id: '4321',
              username: 'John Snow',
              status: {
                state: 'offline',
                lastChanged: '14 July, 20:00'
              }
            }
          ],
          typingUsers: []
        }
      ],
      messages: [
        {
          _id: '7890',
          indexId: 12092,
          content: 'Message 1',
          senderId: '1234',
          username: 'John Doe',
          date: '13 November',
          timestamp: '10:20',
          system: false,
          saved: true,
          distributed: true,
          seen: true,
          deleted: false,
          failure: true,
          disableActions: false,
          disableReactions: false,
          replyMessage: {
            content: 'Reply Message',
            senderId: '4321',
          },
        }
      ],
      roomActions: [
        { name: 'inviteUser', title: 'Invite User' },
        { name: 'removeUser', title: 'Remove User' },
        { name: 'deleteRoom', title: 'Delete Room' }
      ]
    }
  }
}
</script>

@bacca-chew bacca-chew added the bug Something isn't working label Nov 14, 2023
@MkMarko
Copy link

MkMarko commented Dec 20, 2023

你尝试在首次替换新的消息的时候把它的旧消息置空 我发现了这个问题 并且已经通过这种方式解决了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants