Skip to content

Commit

Permalink
Revert "Remove njump.me from the 'open with' menu (it is still used f…
Browse files Browse the repository at this point in the history
…or 'copy web link'), it can be advertised as a handler instead"

This reverts commit a39f206.
  • Loading branch information
mikedilger committed Dec 2, 2024
1 parent 2aa3319 commit 0738ebc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions gossip-bin/src/ui/feed/note/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,24 @@ fn note_actions(
if !note.event.kind.is_direct_message_related() {
let mut my_items: Vec<MoreMenuItem> = Vec::new();

// njump.me
my_items.push(MoreMenuItem::Button(MoreMenuButton::new(
"njump.me",
Box::new(|ui, _| {
let nevent = NEvent {
id: note.event.id,
relays: relays.clone(),
author: None,
kind: None,
};
let url = format!("https://njump.me/{}", nevent.as_bech32_string());
ui.ctx().open_url(egui::OpenUrl {
url: url.clone(),
new_tab: true,
});
}),
)));

if let Some(handlers) = GLOBALS.handlers.get(&note.event.kind) {
for (label, url) in handlers.value().iter() {
let url = if note.event.kind.is_parameterized_replaceable() {
Expand Down

0 comments on commit 0738ebc

Please sign in to comment.