This commit is contained in:
Mike Dilger 2023-01-18 14:25:39 +13:00
parent 08c47a4060
commit 9964ceba09
3 changed files with 6 additions and 9 deletions

View File

@ -721,11 +721,8 @@ impl Overlord {
// Add all the 'p' tags from the note we are replying to (except our own) // Add all the 'p' tags from the note we are replying to (except our own)
for tag in &event.tags { for tag in &event.tags {
match tag { if let Tag::Pubkey { pubkey, .. } = tag {
Tag::Pubkey { pubkey, .. } => { add_pubkey_hex_to_tags(&mut tags, pubkey).await;
add_pubkey_hex_to_tags(&mut tags, pubkey).await;
}
_ => {}
} }
} }

View File

@ -26,7 +26,7 @@ pub fn notes_from_text(text: &str) -> Vec<(String, Id)> {
if !note.starts_with("note1") { if !note.starts_with("note1") {
None None
} else { } else {
Id::try_from_bech32_string(&note) Id::try_from_bech32_string(note)
.ok() .ok()
.map(|id| (note.to_string(), id)) .map(|id| (note.to_string(), id))
} }

View File

@ -172,7 +172,7 @@ fn real_posting_area(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram
ui.menu_button("@", |ui| { ui.menu_button("@", |ui| {
for pair in pairs { for pair in pairs {
if ui.button(pair.0).clicked() { if ui.button(pair.0).clicked() {
if !app.draft.ends_with(' ') && app.draft != "" { if !app.draft.ends_with(' ') && !app.draft.is_empty() {
app.draft.push(' '); app.draft.push(' ');
} }
app.draft.push_str(&pair.1.try_as_bech32_string().unwrap()); app.draft.push_str(&pair.1.try_as_bech32_string().unwrap());
@ -518,8 +518,8 @@ fn render_post_actual(
.add(Label::new(RichText::new("»").size(18.0)).sense(Sense::click())) .add(Label::new(RichText::new("»").size(18.0)).sense(Sense::click()))
.clicked() .clicked()
{ {
if !app.draft.ends_with(" ") && app.draft != "" { if !app.draft.ends_with(' ') && !app.draft.is_empty() {
app.draft.push_str(" "); app.draft.push(' ');
} }
app.draft app.draft
.push_str(&event.id.try_as_bech32_string().unwrap()); .push_str(&event.id.try_as_bech32_string().unwrap());