fix(join): add missing action DISCONNECT_IF_CONNECTED

This commit is contained in:
Travis Shivers 2020-09-04 20:27:14 -05:00
parent c794db0fbc
commit 2171b0c6cd
No known key found for this signature in database
GPG Key ID: EE4CC2891B8FCD33
2 changed files with 8 additions and 2 deletions

View File

@ -33,7 +33,10 @@ export default {
await dispatch('DISCONNECT_IF_CONNECTED');
const properBase = new URL(getters.GET_SERVER, window.location);
const url = combineUrl('socket.io', properBase.toString());
console.log('ESTABLISH_SOCKET_CONNECTION', url.toString());
const { id } = await open(url.origin, {
path: url.pathname,
transports: ['websocket', 'polling'],

View File

@ -105,10 +105,12 @@ export default {
methods: {
...mapActions('synclounge', [
'SET_AND_CONNECT_AND_JOIN_ROOM',
'DISCONNECT_IF_CONNECTED',
]),
async joinInvite() {
this.error = null;
this.loading = true;
try {
await this.SET_AND_CONNECT_AND_JOIN_ROOM({
@ -126,9 +128,10 @@ export default {
}
} catch (e) {
console.log(e);
throw e;
// this.error = e.message;
this.error = e.message;
}
this.loading = false;
},
},
};