Skip to content

Commit

Permalink
display_name
Browse files Browse the repository at this point in the history
  • Loading branch information
hoytech committed Dec 20, 2024
1 parent b7b6477 commit 50e917a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/apps/web/WebData.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@ struct User {

kind0Json = loadKindJson(txn, decomp, 0);

try {
if (kind0Json) username = kind0Json->at("name").get_string();
} catch (std::exception &e) {
if (kind0Json) {
try {
username = kind0Json->at("name").get_string();
} catch (std::exception &e) {}

try {
if (!username.size()) username = kind0Json->at("display_name").get_string();
} catch (std::exception &e) {}
}

if (username.size() == 0) username = to_hex(pubkey.substr(0,4));
Expand Down

0 comments on commit 50e917a

Please sign in to comment.