Prune dead code and key elements by stable ids

This commit is contained in:
2026-11-13 04:37:13 +07:00
parent e9f29dc398
commit 8b9c8bd35e
27 changed files with 244 additions and 250 deletions
-6
View File
@@ -376,12 +376,6 @@ impl DownloadedFile {
LocalFile::Url(_) => Ok(()),
}
}
/// Save the file to the user's downloads (web)
#[cfg(target_arch = "wasm32")]
pub fn save(&self) -> Result<(), Error> {
crate::web_file::download(&self.name, &self.mime, &self.data)
}
}
/// Download and decrypt a file attachment to the user's device
+2 -9
View File
@@ -91,8 +91,6 @@ pub struct NostrRegistry {
signer: UniversalSigner,
/// Current user's public key
current_user: Option<PublicKey>,
/// Whether the stored credential needs a passphrase to unlock
passphrase_required: bool,
/// Tasks for asynchronous operations
tasks: Vec<Task<Result<(), Error>>>,
}
@@ -175,7 +173,6 @@ impl NostrRegistry {
client,
signer,
current_user: None,
passphrase_required: false,
tasks: vec![],
}
}
@@ -209,7 +206,6 @@ impl NostrRegistry {
this.update(cx, |this, cx| {
this.signer.swap_inner(new_signer);
this.current_user = Some(public_key);
this.passphrase_required = false;
cx.emit(StateEvent::SignerChanged);
cx.notify();
@@ -291,8 +287,7 @@ impl NostrRegistry {
this.set_signer(signer, cx);
})?;
} else if content.starts_with("ncryptsec1") {
this.update(cx, |this, cx| {
this.passphrase_required = true;
this.update(cx, |_this, cx| {
cx.emit(StateEvent::PassphraseRequired);
})?;
} else if content == "proxy" {
@@ -492,9 +487,8 @@ impl NostrRegistry {
/// Sign out and remove the stored credential
pub fn sign_out(&mut self, cx: &mut Context<Self>) {
self.current_user = None;
self.passphrase_required = false;
credentials::delete(cx).detach_and_log_err(cx);
cx.emit(StateEvent::SignerChanged);
cx.emit(StateEvent::NoSigner);
cx.notify();
@@ -519,7 +513,6 @@ impl NostrRegistry {
credentials::write(cx, "extension", b"extension").detach_and_log_err(cx);
this.signer.swap_inner(signer);
this.current_user = Some(public_key);
this.passphrase_required = false;
cx.emit(StateEvent::SignerChanged);
cx.notify();