store multi accounts
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m37s
Rust / build (ubuntu-latest, stable) (pull_request) Failing after 1m28s
Rust / build (macos-latest, stable) (push) Has been cancelled
Rust / build (windows-latest, stable) (push) Has been cancelled
Rust / build (macos-latest, stable) (pull_request) Has been cancelled
Rust / build (windows-latest, stable) (pull_request) Has been cancelled

This commit is contained in:
2026-03-01 13:43:18 +07:00
parent 551a0a5093
commit f8e6b3ff7a
8 changed files with 526 additions and 495 deletions

View File

@@ -262,9 +262,12 @@ impl ChatRegistry {
pub fn get_contact_list(&mut self, cx: &mut Context<Self>) {
let nostr = NostrRegistry::global(cx);
let client = nostr.read(cx).client();
let signer = nostr.read(cx).signer();
let public_key = signer.public_key().unwrap();
let Some(public_key) = signer.public_key() else {
return;
};
let write_relays = nostr.read(cx).write_relays(&public_key, cx);
let task: Task<Result<(), Error>> = cx.background_spawn(async move {
@@ -318,9 +321,12 @@ impl ChatRegistry {
fn verify_relays(&mut self, cx: &mut Context<Self>) -> Task<Result<InboxState, Error>> {
let nostr = NostrRegistry::global(cx);
let client = nostr.read(cx).client();
let signer = nostr.read(cx).signer();
let public_key = signer.public_key().unwrap();
let Some(public_key) = signer.public_key() else {
return Task::ready(Err(anyhow!("User not found")));
};
let write_relays = nostr.read(cx).write_relays(&public_key, cx);
cx.background_spawn(async move {

View File

@@ -331,7 +331,7 @@ impl Room {
let client = nostr.read(cx).client();
let signer = nostr.read(cx).signer();
let sender = signer.public_key().unwrap();
let sender = signer.public_key();
// Get room's id
let id = self.id;
@@ -340,7 +340,7 @@ impl Room {
let members: Vec<PublicKey> = self
.members
.iter()
.filter(|public_key| public_key != &&sender)
.filter(|public_key| Some(**public_key) != sender)
.copied()
.collect();