mirror of
https://github.com/aljazceru/meshcore-web.git
synced 2025-12-17 16:24:18 +01:00
clear previous connection state before connecting
This commit is contained in:
@@ -58,6 +58,9 @@ class Connection {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clear previous connection state
|
||||||
|
GlobalState.contacts = [];
|
||||||
|
|
||||||
// update connection and listen for events
|
// update connection and listen for events
|
||||||
GlobalState.connection = connection;
|
GlobalState.connection = connection;
|
||||||
GlobalState.connection.on("connected", () => this.onConnected());
|
GlobalState.connection.on("connected", () => this.onConnected());
|
||||||
@@ -90,9 +93,6 @@ class Connection {
|
|||||||
onDatabaseReady = resolve;
|
onDatabaseReady = resolve;
|
||||||
});
|
});
|
||||||
|
|
||||||
// clear previous connection state
|
|
||||||
GlobalState.contacts = [];
|
|
||||||
|
|
||||||
// log raw tx bytes if enabled
|
// log raw tx bytes if enabled
|
||||||
GlobalState.connection.on("tx", async (data) => {
|
GlobalState.connection.on("tx", async (data) => {
|
||||||
if(this.log){
|
if(this.log){
|
||||||
|
|||||||
Reference in New Issue
Block a user