mirror of
https://github.com/tenrok/vue-native-websocket.git
synced 2026-05-17 04:19:38 +03:00
Prevent reconnect after timeout for previously destroyed socket (with use $disconnect method)
This commit is contained in:
+4
-1
@@ -20,7 +20,10 @@ export default {
|
||||
}
|
||||
|
||||
Vue.prototype.$disconnect = () => {
|
||||
if (observer && observer.reconnection) { observer.reconnection = false }
|
||||
if (observer && observer.reconnection) {
|
||||
observer.reconnection = false
|
||||
clearTimeout(observer.reconnectTimeoutId)
|
||||
}
|
||||
if (Vue.prototype.$socket) {
|
||||
Vue.prototype.$socket.close()
|
||||
delete Vue.prototype.$socket
|
||||
|
||||
Reference in New Issue
Block a user