mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-29 08:21:47 +00:00
UI menu option to post again
This commit is contained in:
parent
aeaa679be3
commit
caf6d21a48
@ -16,7 +16,7 @@ use egui::{
|
||||
use gossip_lib::comms::ToOverlordMessage;
|
||||
use gossip_lib::DmChannel;
|
||||
use gossip_lib::FeedKind;
|
||||
use gossip_lib::{ZapState, GLOBALS};
|
||||
use gossip_lib::{Globals, ZapState, GLOBALS};
|
||||
use nostr_types::{
|
||||
Event, EventAddr, EventDelegation, EventKind, EventPointer, EventReference, IdHex, NostrUrl,
|
||||
UncheckedUrl,
|
||||
@ -522,6 +522,28 @@ fn render_note_inner(
|
||||
*keep_open = false;
|
||||
}
|
||||
}
|
||||
// Chance to post our note again to relays it missed
|
||||
if let Some(our_pubkey) = GLOBALS.identity.public_key() {
|
||||
if note.event.pubkey == our_pubkey {
|
||||
if let Ok(broadcast_relays) = Globals::relays_for_event(¬e.event)
|
||||
{
|
||||
if !broadcast_relays.is_empty() {
|
||||
if ui
|
||||
.button(&format!(
|
||||
"Post again ({})",
|
||||
broadcast_relays.len()
|
||||
))
|
||||
.clicked()
|
||||
{
|
||||
let _ = GLOBALS.to_overlord.send(
|
||||
ToOverlordMessage::PostAgain(note.event.clone()),
|
||||
);
|
||||
*keep_open = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ui.button("Rerender").clicked() {
|
||||
app.notes.cache_invalidate_note(¬e.event.id);
|
||||
*keep_open = false;
|
||||
|
Loading…
Reference in New Issue
Block a user