Merge pull request #506 from dtonon/feature/njump-update

njump update
This commit is contained in:
Michael Dilger 2023-09-24 17:31:31 +13:00 committed by GitHub
commit 0cfb4958fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

View File

@ -408,7 +408,7 @@ fn render_note_inner(
};
ui.output_mut(|o| {
o.copied_text = format!(
"https://nostr.com/{}",
"https://njump.me/{}",
event_pointer.as_bech32_string()
)
});

View File

@ -44,7 +44,7 @@ use egui::{
#[cfg(feature = "video-ffmpeg")]
use egui_video::{AudioDevice, Player};
use egui_winit::egui::Response;
use nostr_types::{Id, IdHex, Metadata, MilliSatoshi, PublicKey, UncheckedUrl, Url};
use nostr_types::{Id, IdHex, Metadata, MilliSatoshi, Profile, PublicKey, UncheckedUrl, Url};
use std::collections::{HashMap, HashSet};
#[cfg(feature = "video-ffmpeg")]
use std::rc::Rc;
@ -1113,6 +1113,24 @@ impl GossipUi {
.to_overlord
.send(ToOverlordMessage::UpdateMetadata(person.pubkey));
}
if ui.button("Copy web link").clicked() {
ui.output_mut(|o| {
let mut profile = Profile {
pubkey: person.pubkey,
relays: Vec::new(),
};
let relays = GLOBALS.people.get_active_person_write_relays();
for (relay_url, _) in relays.iter().take(3) {
profile.relays.push(UncheckedUrl(format!("{}", relay_url)));
}
o.copied_text = format!(
"https://njump.me/{}",
profile.as_bech32_string()
)
});
}
});
if followed {