|
@@ -24,7 +24,7 @@
|
|
|
<v-stepper-content step="1">
|
|
|
<v-card class="mb-12" color="grey lighten-1" height="200px">
|
|
|
<div class="checkin-form d-flex justify-content-center align-items-center">
|
|
|
- <div>
|
|
|
+ <form ref="baseForm">
|
|
|
<!-- <input type="hidden" name="lobbyUid" value />
|
|
|
<input type="hidden" name="_api" value="/api/meeting/createAsStrangerPerformer" />
|
|
|
<input type="hidden" name="_success" value="/pro/login" />
|
|
@@ -42,7 +42,7 @@
|
|
|
<div class="input-group mb-3">
|
|
|
<input type="date" name="strangerDob" class="form-control" placeholder="Date of Birth" v-model="user.dateOfBirth" required />
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </form>
|
|
|
</div>
|
|
|
</v-card>
|
|
|
|
|
@@ -203,9 +203,13 @@ export default {
|
|
|
checkIn() {
|
|
|
this.loading = true;
|
|
|
this.meetingName = `${this.user.firstName} ${this.user.lastName} ${this.user.dateOfBirth}`;
|
|
|
+ if (!this.$refs.baseForm.reportValidity()) {
|
|
|
+ this.loading = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
$.ajax({
|
|
|
- url: "/post-to-api",
|
|
|
+ url: "/post-to-api-ajax",
|
|
|
method: "POST",
|
|
|
headers: {
|
|
|
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content")
|
|
@@ -220,6 +224,10 @@ export default {
|
|
|
strangerDob: this.user.dateOfBirth
|
|
|
},
|
|
|
success: data => {
|
|
|
+ if (!data.success) {
|
|
|
+ alert(data.message);
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.stepper = 2;
|
|
|
this.meetingUid = data.data;
|
|
|
|
|
@@ -303,18 +311,17 @@ export default {
|
|
|
cont.el.appendChild(cont.obj.element);
|
|
|
this.getToken();
|
|
|
|
|
|
- this.$socket.emit('meetingJoined',
|
|
|
- {
|
|
|
- lobby_uid: this.lobbyProp.uid,
|
|
|
- meeting_name: this.meetingName,
|
|
|
- meeting_uid: this.meetingUid,
|
|
|
- user: {
|
|
|
- name: `${this.firstName} ${this.lastName}`,
|
|
|
- type: 'STRANGER',
|
|
|
- uid: this.clientUid
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
+ this.$socket.emit("meetingJoined", {
|
|
|
+ lobby_uid: this.lobbyProp.uid,
|
|
|
+ meeting_name: this.meetingName,
|
|
|
+ meeting_uid: this.meetingUid,
|
|
|
+ user: {
|
|
|
+ name: `${this.firstName} ${this.lastName}`,
|
|
|
+ type: "STRANGER",
|
|
|
+ uid: this.clientUid
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
/* Copied */
|
|
|
disconnect() {
|
|
@@ -337,7 +344,7 @@ export default {
|
|
|
// if (this.meeting.scheduledDate && !this.meeting.startedAt && this.meeting.scheduledDate > new Date() && (this.user.type === "guest" || !confirm("Meeting not started. Start it now?")))
|
|
|
// return;
|
|
|
$.ajax({
|
|
|
- url: "/post-to-api",
|
|
|
+ url: "/post-to-api-ajax",
|
|
|
method: "POST",
|
|
|
headers: {
|
|
|
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content")
|
|
@@ -347,6 +354,18 @@ export default {
|
|
|
uid: this.meetingUid
|
|
|
},
|
|
|
success: data => {
|
|
|
+ if (!data.success) {
|
|
|
+ alert(data.message);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // this.$refs.initialModal.hide();
|
|
|
+ // if (!isAssociate) {
|
|
|
+ // const user = Object.assign({}, this.user);
|
|
|
+ // user.id = data.participantId;
|
|
|
+ // user.name = data.participantName;
|
|
|
+ // user.pin = data.participantPin;
|
|
|
+ // this.$store.commit("setUser", user);
|
|
|
+ // }
|
|
|
this.initializeOpenTok(data.data.apiKey, data.data.sessionId, data.data.token);
|
|
|
},
|
|
|
error: jXhr => {
|
|
@@ -470,6 +489,7 @@ export default {
|
|
|
sessionDisconnected: event => {
|
|
|
if (event.reason === "forceDisconnected") {
|
|
|
alert("You were kicked.");
|
|
|
+ window.location.reload();
|
|
|
//TODO: Kicked
|
|
|
// if (this.user.type === "associate") {
|
|
|
// this.disconnect();
|
|
@@ -659,7 +679,7 @@ export default {
|
|
|
|
|
|
this.$eventBus.$on("leaveMeeting", () => {
|
|
|
$.ajax({
|
|
|
- url: "/associate/meeting/leave",
|
|
|
+ url: "/post-to-api-ajax",
|
|
|
method: "POST",
|
|
|
headers: {
|
|
|
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content")
|