Skip to content

Commit

Permalink
++
Browse files Browse the repository at this point in the history
  • Loading branch information
prevetal committed Oct 14, 2024
1 parent 55930b7 commit 400ba3b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions js/jetPack.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,21 @@
// Reject promise on error
reject(err)
})

// Handle disconnection event
this.#conn.on('close', () => {
console.warn('Connection closed.')

// Set the connection status to false
this.#isConnected = false
})

this.#conn.on('disconnected', () => {
console.warn('Connection lost.')

// Set the connection status to false
this.#isConnected = false
})
}, this.#connectionInterval)
} catch (error) {
console.error('Failed to open URL:', error)
Expand Down

0 comments on commit 400ba3b

Please sign in to comment.