chore: misc

This commit is contained in:
2023-02-20 14:18:41 +00:00
parent 0545a07ea6
commit b23b1764e5
4 changed files with 19 additions and 7 deletions

View File

@ -82,7 +82,6 @@ export default class Connection {
this.EventsCallback = new Map();
this.AwaitingAuth = new Map();
this.Authed = false;
this.Connect();
}
async Connect() {

View File

@ -82,10 +82,11 @@ export class NostrSystem {
/**
* Connect to a NOSTR relay if not already connected
*/
ConnectToRelay(address: string, options: RelaySettings) {
async ConnectToRelay(address: string, options: RelaySettings) {
try {
if (!this.Sockets.has(address)) {
const c = new Connection(address, options);
await c.Connect();
this.Sockets.set(address, c);
for (const [, s] of this.Subscriptions) {
c.AddSubscription(s);