check name.length > 0
This commit is contained in:
parent
40e05480e6
commit
4e2b7e6bb9
@ -18,9 +18,9 @@ export function getDisplayNameOrPlaceHolder(user: UserMetadata | undefined, pubk
|
||||
let name = hexToBech32(NostrPrefix.PublicKey, pubkey).substring(0, 12);
|
||||
let isPlaceHolder = false;
|
||||
|
||||
if (user?.display_name) {
|
||||
if (typeof user?.display_name === "string" && user.display_name.length > 0) {
|
||||
name = user.display_name;
|
||||
} else if (user?.name) {
|
||||
} else if (typeof user?.name === "string" && user.name.length > 0) {
|
||||
name = user.name;
|
||||
} else if (pubkey && process.env.ANIMAL_NAME_PLACEHOLDERS) {
|
||||
name = AnimalName(pubkey);
|
||||
|
@ -6,7 +6,7 @@ import Nip5Service from "Element/Nip5Service";
|
||||
*/
|
||||
|
||||
import messages from "./messages";
|
||||
import IrisAccount from "../Element/IrisAccount/IrisAccount";
|
||||
import IrisAccount from "Element/IrisAccount/IrisAccount";
|
||||
|
||||
export default function FreeNostrAddressPage() {
|
||||
return (
|
||||
|
@ -25,7 +25,7 @@ import { useEventFeed } from "Feed/EventFeed";
|
||||
import { LoginSession, LoginStore } from "Login";
|
||||
import { Nip28ChatSystem } from "chat/nip28";
|
||||
import { ChatParticipantProfile } from "Element/Chat/ChatParticipant";
|
||||
import { getDisplayName } from "../Element/User/DisplayName";
|
||||
import { getDisplayName } from "Element/User/DisplayName";
|
||||
|
||||
const TwoCol = 768;
|
||||
const ThreeCol = 1500;
|
||||
|
@ -19,7 +19,7 @@ import Text from "Element/Text";
|
||||
import { formatShort } from "Number";
|
||||
import { LiveEvent } from "Element/LiveEvent";
|
||||
import ProfilePreview from "Element/User/ProfilePreview";
|
||||
import { getDisplayName } from "../Element/User/DisplayName";
|
||||
import { getDisplayName } from "Element/User/DisplayName";
|
||||
|
||||
function notificationContext(ev: TaggedNostrEvent) {
|
||||
switch (ev.kind) {
|
||||
|
@ -58,7 +58,7 @@ import { ZapTarget } from "Zapper";
|
||||
import { useStatusFeed } from "Feed/StatusFeed";
|
||||
|
||||
import messages from "./messages";
|
||||
import { SpotlightMediaModal } from "../Element/Deck/SpotlightMedia";
|
||||
import { SpotlightMediaModal } from "Element/Deck/SpotlightMedia";
|
||||
|
||||
const NOTES = 0;
|
||||
const REACTIONS = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user