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)
for tag in &event.tags {
match tag {
Tag::Pubkey { pubkey, .. } => {
add_pubkey_hex_to_tags(&mut tags, pubkey).await;
}
_ => {}
if let Tag::Pubkey { pubkey, .. } = tag {
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") {
None
} else {
Id::try_from_bech32_string(&note)
Id::try_from_bech32_string(note)
.ok()
.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| {
for pair in pairs {
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_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()))
.clicked()
{
if !app.draft.ends_with(" ") && app.draft != "" {
app.draft.push_str(" ");
if !app.draft.ends_with(' ') && !app.draft.is_empty() {
app.draft.push(' ');
}
app.draft
.push_str(&event.id.try_as_bech32_string().unwrap());