fix: do not lose subscriptions if no relay
This commit is contained in:
parent
c0632cabe5
commit
af14e1c47b
2 changed files with 10 additions and 3 deletions
|
|
@ -62,11 +62,9 @@ async def api_add_relay(relay: Relay) -> Optional[RelayList]:
|
|||
|
||||
all_relays: List[NostrRelay] = nostr.client.relay_manager.relays.values()
|
||||
if len(all_relays):
|
||||
subscriptions = all_relays[0].subscriptions
|
||||
nostr.client.relays.append(relay.url)
|
||||
nostr.client.relay_manager.add_relay(subscriptions)
|
||||
nostr.client.relay_manager.add_relay()
|
||||
|
||||
nostr.client.relay_manager.connect_relay(relay.url)
|
||||
|
||||
return await get_relays()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue