mirror of
https://github.com/tenrok/vue-native-websocket.git
synced 2026-06-11 01:12:26 +03:00
release 10
This commit is contained in:
+6
-4
@@ -3,10 +3,12 @@ import Emitter from './Emitter'
|
||||
export default class {
|
||||
constructor (connectionUrl, opts = {}) {
|
||||
this.format = opts.format && opts.format.toLowerCase()
|
||||
if(connectionUrl.startsWith('//')){
|
||||
const scheme = window.location.protocol === 'https:' ? 'wss' : 'ws';
|
||||
|
||||
if (connectionUrl.startsWith('//')) {
|
||||
const scheme = window.location.protocol === 'https:' ? 'wss' : 'ws'
|
||||
connectionUrl = `${scheme}://${connectionUrl}`
|
||||
}
|
||||
|
||||
this.connectionUrl = connectionUrl
|
||||
this.opts = opts
|
||||
|
||||
@@ -93,9 +95,9 @@ export default class {
|
||||
}
|
||||
}
|
||||
if (this.mutations) {
|
||||
this.store[this.mutations[method] || method](target, msg)
|
||||
this.store[this.mutations[method] || method](target, msg)
|
||||
} else {
|
||||
this.store[method](target, msg)
|
||||
this.store[method](target, msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user