Fix display after setting relay manually

This commit is contained in:
Mike Dilger 2023-10-28 09:35:48 +13:00
parent adc16199d8
commit cdcd23f072
2 changed files with 11 additions and 0 deletions

View File

@ -731,6 +731,13 @@ impl Overlord {
pr.manually_paired_write = true;
GLOBALS.storage.write_person_relay(&pr, None)?;
if let Some(pk) = GLOBALS.people.get_active_person_async().await {
if pk == pubkey {
// Refresh active person data from storage
GLOBALS.people.set_active_person(pubkey).await?;
}
}
self.pick_relays().await;
Ok(())

View File

@ -874,6 +874,10 @@ impl People {
*self.active_person.blocking_read()
}
pub async fn get_active_person_async(&self) -> Option<PublicKey> {
*self.active_person.read().await
}
pub fn get_active_person_write_relays(&self) -> Vec<(RelayUrl, u64)> {
self.active_persons_write_relays.blocking_read().clone()
}