Ver Fonte

new meetings socket support

Flavionel há 5 anos atrás
pai
commit
6af08c1084

+ 0 - 11
resources/js/components/pages/ClientEntrance.vue

@@ -278,17 +278,6 @@ export default {
                             this.$set(cont, "self", true);
                             this.cameraWorkingConfirmed = true;
 
-                            this.$socket.emit("meetingJoined", {
-                                lobby_uid: this.lobbyProp.uid,
-                                meeting_name: this.meetingName,
-                                meeting_uid: this.meetingUid,
-                                user: {
-                                    name: `${this.user.firstName} ${this.user.lastName}`,
-                                    type: "STRANGER",
-                                    uid: this.clientUid
-                                }
-                            });
-
                             if (this.stepper == 3) {
                                 this.gotoStep3();
                             }

+ 4 - 0
resources/js/components/pages/MeetingsAppRoot.vue

@@ -183,6 +183,10 @@ export default {
         this.sockets.subscribe("meeting-activity", data => {
             this.$store.commit("setLobbyActivity", data)
         })
+
+        this.sockets.subscribe("meeting-created", data => {
+            this.$store.commit("setNewMeetingInLobby", data);
+        })
     }
 };
 </script>

+ 4 - 2
resources/js/components/vuex/index.js

@@ -93,10 +93,12 @@ export default () => new Vuex.Store({
 
         },
         setNewMeetingInLobby(state, data) {
-            let lobby = state.lobbies.filter((cur) => cur.id == parseInt(data.lobby.id))
+            let lobby = state.lobbies.filter((cur) => cur.uid == data.lobby.uid)
 
             if (lobby.length) {
-                data.finalDate = new Date(data.scheduled_date ? data.scheduled_date : data.created_at)
+                data.active_members = []
+                data.pros_online = []
+
                 lobby[0].meetings.push(data)
                 lobby[0].meetings.sort((a, b) => {
                     return a.finalDate - b.finalDate