2
0
mirror of https://github.com/tenrok/vue-native-websocket.git synced 2026-06-07 15:42:27 +03:00

Merge pull request #153 from sergak01/patch-1

Prevent reconnect after timeout for previously destroyed socket (with use $disconnect method)
This commit is contained in:
Viktor
2022-07-25 13:28:43 +03:00
committed by GitHub
+4 -1
View File
@@ -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