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