Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
424d9cca91 | |||
d712270946 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartsocket",
|
||||
"version": "1.1.57",
|
||||
"version": "1.1.58",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartsocket",
|
||||
"version": "1.1.57",
|
||||
"version": "1.1.58",
|
||||
"description": "easy and secure websocket communication",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
|
@ -112,6 +112,11 @@ export class SmartsocketClient {
|
||||
|
||||
});
|
||||
|
||||
// handle connection
|
||||
this.socketConnection.socket.on('connect', async () => {
|
||||
this.updateStatus('connected');
|
||||
});
|
||||
|
||||
// handle disconnection and errors
|
||||
this.socketConnection.socket.on('disconnect', async () => {
|
||||
await this.disconnect();
|
||||
|
@ -68,6 +68,11 @@ export class SocketConnection {
|
||||
|
||||
// standard behaviour that is always true
|
||||
allSocketConnections.add(this);
|
||||
|
||||
// handle connection
|
||||
this.socket.on('connect', async () => {
|
||||
this.updateStatus('connected');
|
||||
});
|
||||
this.socket.on('disconnect', async () => {
|
||||
plugins.smartlog.defaultLogger.log(
|
||||
'info',
|
||||
|
Reference in New Issue
Block a user