Parcourir la source

further socket adjustments - close meeting added

Flavionel il y a 5 ans
Parent
commit
fdf01e6962

+ 9 - 3
resources/js/components/pages/ClientEntrance.vue

@@ -657,6 +657,10 @@ export default {
             let self = this;
         }
 
+        this.sockets.subscribe("meeting-closed", data => {
+            this.$eventBus.$emit("leaveMeeting")
+        })
+
         let self = this;
 
         this.$eventBus.$on("meetingRejoin", () => {
@@ -685,11 +689,13 @@ export default {
                     "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content")
                 },
                 error: jXhr => {
-                    console.error(getSingleError(jXhr));
+                    console.error(getSingleError(jXhr))
                 }
             });
-            this.$store.dispatch("leaveMeeting");
-            this.disconnect();
+            this.$store.dispatch("leaveMeeting")
+            this.$socket.emit('meetingLeft')
+            this.disconnect()
+            alert('Meeting was Closed.')
         });
     }
 };

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

@@ -190,6 +190,10 @@ export default {
             this.$store.commit("setUpdatedMeetingInLobby", data);
         })
 
+        this.sockets.subscribe("meeting-closed", data => {
+            this.$eventBus.$emit("leaveMeeting")
+        })
+
         /* Lobby Handlers */
 
         this.sockets.subscribe("lobby-updated", data => {

+ 2 - 0
resources/js/components/partials/LobbyList.vue

@@ -73,6 +73,8 @@
                         <v-card-actions>
                             <v-btn :disabled="lobby.selected_meeting !== 0 && !lobby.selected_meeting" color="deep-purple accent-4" text @click="joinMeeting(lobby)">Join</v-btn>
                             <v-btn :disabled="lobby.selected_meeting !== 0 && !lobby.selected_meeting" color="deep-purple accent-4" text @click="inviteToMeeting(lobby)">Invite</v-btn>
+                            <v-spacer></v-spacer>
+                            <v-btn :disabled="lobby.selected_meeting !== 0 && !lobby.selected_meeting" color="deep-purple accent-4" text @click="closeMeeting(lobby)">Close</v-btn>
                         </v-card-actions>
                     </div>
                 </transition-expand>

+ 1 - 2
resources/js/components/partials/MeetingRoom.vue

@@ -435,12 +435,11 @@ export default {
         "meeting.uid"(val) {
             if (this.loadingInProgress) return;
             this.loadingInProgress = true;
-            this.disconnect();
 
             if (val) {
                 this.getToken();
             } else {
-                this.disconnect();
+                //this.disconnect(); - causing openTok errors
                 this.loadingInProgress = false;
             }
         }

+ 5 - 7
resources/js/components/vuex/index.js

@@ -138,16 +138,14 @@ export default () => new Vuex.Store({
     actions: {
         leaveMeeting(store) {
             let meeting = {
-                id: '',
+                uid: null,
+                lobby_uid: null,
                 name: '',
-                passwordRequired: false,
-                lobby: null,
-                active_members: 0,
-                scheduledDate: null,
-                startedAt: null
+                active_members: [],
+                pros_online: []
             }
 
-            store.commit('setMeeting', meeting)
+            store.commit('setCurrentMeeting', meeting)
         }
     }
 })