clear previous connection state before connecting

This commit is contained in:
liamcottle
2025-02-16 04:24:44 +13:00
parent 1cea505396
commit f885391ef5

View File

@@ -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){