upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-12-11 08:04:41 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-12-11 08:04:41 +0000
commitc72585a97736384ebe9e8e82a6311387808051fa (patch)
tree5c7f0ae92ea5df1cef32e6e082f125424c49bddd /src
parent36eb9395567dc0022b1700ec9cda1389baf22476 (diff)
fix(NostrUrlDecoded): add nip05 loading to TUI
so the user understands the cause of any delay if the domain takes a while to respond
Diffstat (limited to 'src')
-rw-r--r--src/lib/git/nostr_url.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/git/nostr_url.rs b/src/lib/git/nostr_url.rs
index bc56e1a..39ce60e 100644
--- a/src/lib/git/nostr_url.rs
+++ b/src/lib/git/nostr_url.rs
@@ -191,11 +191,16 @@ impl NostrUrlDecoded {
191 { 191 {
192 public_key 192 public_key
193 } else { 193 } else {
194 // TODO eprint loading message 194 let term = console::Term::stderr();
195 let domain = {
196 let s = npub_or_nip05.split('@').collect::<Vec<&str>>();
197 if s.len() == 2 { s[1] } else { s[0] }
198 };
199 term.write_line(&format!("fetching pubic key info from {domain}..."))?;
195 let res = nip05::profile(npub_or_nip05, None) 200 let res = nip05::profile(npub_or_nip05, None)
196 .await 201 .await
197 .context(INCORRECT_NOSTR_URL_FORMAT_ERROR)?; 202 .context(INCORRECT_NOSTR_URL_FORMAT_ERROR)?;
198 // TODO clear loading message 203 term.clear_last_lines(1)?;
199 nip05 = Some(npub_or_nip05.to_string()); 204 nip05 = Some(npub_or_nip05.to_string());
200 let _ = save_nip05_to_git_config_cache( 205 let _ = save_nip05_to_git_config_cache(
201 npub_or_nip05, 206 npub_or_nip05,