check name.length > 0
Some checks reported errors
continuous-integration/drone/pr Build encountered an error

This commit is contained in:
Martti Malmi 2023-10-06 11:57:46 +03:00
parent 40e05480e6
commit 4e2b7e6bb9
5 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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 (

View File

@ -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;

View File

@ -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) {

View File

@ -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;