Code Monkey home page Code Monkey logo

Comments (8)

antoine92190 avatar antoine92190 commented on May 26, 2024

I believe you need to set this.loadingRooms = true, fetch your list, then this.loadingRooms = false

from vue-advanced-chat.

deepweller avatar deepweller commented on May 26, 2024

RoomList area loading is works well.
But room area is still loading...
I sent screen record file to email. (yellow button is refresh room buttion.)

from vue-advanced-chat.

antoine92190 avatar antoine92190 commented on May 26, 2024

Maybe this can help: #40 (comment)

from vue-advanced-chat.

deepweller avatar deepweller commented on May 26, 2024

I already changed messageLoaded props.
I think room data is not initialized when rooms props was setted empty array [].(like above image)
Actually I want to unselect(or refresh) room data feature when I set rooms props to empty array. (fetchMessages event is not emitted.)

from vue-advanced-chat.

antoine92190 avatar antoine92190 commented on May 26, 2024

Would you be able to share here your full component code snippet so I can reproduce the issue?

from vue-advanced-chat.

deepweller avatar deepweller commented on May 26, 2024

I found issue. The cause of the issue is that I put them in rooms prop sequentially when I get room list to server.
I changed it to put it at once.
before

    getRooms() {
        this.rooms = []
        getChannels().then(async res => {
          for (let i = 0; i < res.channels.length; i++) {
            if (!res.channels[i].name.startsWith('chat_')) {
              continue
            }

            let members = await this.getChannelMembers(res.channels[i]._id);

            const room = {
              roomId: res.channels[i]._id,
              roomName: res.channels[i].name,
              users: members.members,
              type: 'channel',
              offset: 0,
              unreadCount: 0,
            }

            await this.subRoom(room)
            this.rooms.push(room)
          }
        })
      }

after

    getRooms() {
        let rooms = []
        getChannels().then(async res => {
          for (let i = 0; i < res.channels.length; i++) {
            if (!res.channels[i].name.startsWith('chat_')) {
              continue
            }

            let members = await this.getChannelMembers(res.channels[i]._id);

            const room = {
              roomId: res.channels[i]._id,
              roomName: res.channels[i].name,
              users: members.members,
              type: 'channel',
              offset: 0,
              unreadCount: 0,
            }

            await this.subRoom(room)
            rooms.push(room)
          }
          this.rooms = rooms
        })
      }

from vue-advanced-chat.

antoine92190 avatar antoine92190 commented on May 26, 2024

Ok cool. I will have a look and check if I can allow the first method to work as well.

from vue-advanced-chat.

antoine92190 avatar antoine92190 commented on May 26, 2024

Actually, I will not change the current behaviour as it may lead to performance issues.
Instead, I added guidelines in the readme:
https://github.com/antoine92190/vue-advanced-chat#important-notes

from vue-advanced-chat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.