ensure relay connection
This commit is contained in:
@@ -105,12 +105,17 @@ impl ChatRegistry {
|
||||
subscriptions.push(
|
||||
// Subscribe to the signer event
|
||||
cx.subscribe(&nostr, |this, _state, event, cx| {
|
||||
if let StateEvent::SignerSet = event {
|
||||
this.reset(cx);
|
||||
this.get_rooms(cx);
|
||||
this.get_contact_list(cx);
|
||||
this.get_messages(cx)
|
||||
}
|
||||
match event {
|
||||
StateEvent::SignerSet => {
|
||||
this.reset(cx);
|
||||
this.get_rooms(cx);
|
||||
}
|
||||
StateEvent::RelayConnected => {
|
||||
this.get_contact_list(cx);
|
||||
this.get_messages(cx)
|
||||
}
|
||||
_ => {}
|
||||
};
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -332,6 +337,7 @@ impl ChatRegistry {
|
||||
|
||||
while let Some((_url, res)) = stream.next().await {
|
||||
if let Ok(event) = res {
|
||||
log::debug!("Got event: {:?}", event);
|
||||
let urls: Vec<RelayUrl> = nip17::extract_owned_relay_list(event).collect();
|
||||
return Ok(urls);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user