mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 11:43:43 +00:00
When showing tags under post, translate keys to names
This commit is contained in:
parent
3a68d8fd00
commit
caad5348cd
@ -257,7 +257,20 @@ fn real_posting_area(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram
|
|||||||
|
|
||||||
// List of tags to be applied
|
// List of tags to be applied
|
||||||
for (i, tag) in app.draft_tags.iter().enumerate() {
|
for (i, tag) in app.draft_tags.iter().enumerate() {
|
||||||
ui.label(format!("{}: {}", i, serde_json::to_string(tag).unwrap()));
|
let rendered = match tag {
|
||||||
|
Tag::Pubkey { pubkey, .. } => {
|
||||||
|
if let Some(person) = GLOBALS.people.blocking_write().get(&(*pubkey).into()) {
|
||||||
|
match person.name {
|
||||||
|
Some(name) => name,
|
||||||
|
None => GossipUi::pubkey_long(pubkey),
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
GossipUi::pubkey_long(pubkey)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => serde_json::to_string(tag).unwrap(),
|
||||||
|
};
|
||||||
|
ui.label(format!("{}: {}", i, rendered));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user