This commit is contained in:
2026-03-14 09:10:23 +07:00
parent fec148dcb5
commit 0fc7d2f6d1
5 changed files with 59 additions and 16 deletions

View File

@@ -44,6 +44,8 @@ impl Global for GlobalNostrRegistry {}
/// Signer event.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub enum StateEvent {
/// Creating the signer
Creating,
/// Connecting to the bootstrapping relay
Connecting,
/// Connected to the bootstrapping relay
@@ -289,6 +291,9 @@ impl NostrRegistry {
// Create a write credential task
let write_credential = cx.write_credentials(&username, &username, &secret);
// Emit creating event
cx.emit(StateEvent::Creating);
// Run async tasks in background
let task: Task<Result<(), Error>> = cx.background_spawn(async move {
let signer = async_keys.into_nostr_signer();
@@ -301,7 +306,7 @@ impl NostrRegistry {
client
.send_event(&event)
.to(BOOTSTRAP_RELAYS)
.ok_timeout(Duration::from_secs(TIMEOUT))
.ack_policy(AckPolicy::none())
.await?;
// Construct the default metadata