@ -1,7 +1,7 @@
import { Event } from 'nostr-tools' ;
import { Event } from 'nostr-tools' ;
import { elem , elemCanvas , parseTextContent } from './utils/dom' ;
import { elem , elemCanvas , parseTextContent } from './utils/dom' ;
import { getNoxyUrl } from './utils/url' ;
import { getNoxyUrl } from './utils/url' ;
import { getView Content, getView Elem} from './view' ;
import { getView Elem} from './view' ;
import { parseJSON } from './media' ;
import { parseJSON } from './media' ;
import { sortByCreatedAt } from './events' ;
import { sortByCreatedAt } from './events' ;
@ -104,10 +104,9 @@ export const getMetadata = (pubkey: string) => {
} ;
} ;
export const renderProfile = ( pubkey : string ) = > {
export const renderProfile = ( pubkey : string ) = > {
const content = getViewContent ( ) ;
const header = getViewElem ( 'header' ) ;
const header = getViewElem ( pubkey ) ;
const metadata = profileMap [ pubkey ] ;
const metadata = profileMap [ pubkey ] ;
if ( ! content || ! header || ! metadata ) {
if ( ! header || ! metadata ) {
return ;
return ;
}
}
if ( metadata . name ) {
if ( metadata . name ) {
@ -119,8 +118,8 @@ export const renderProfile = (pubkey: string) => {
header . append ( elem ( 'h1' , { } , metadata . name ) ) ;
header . append ( elem ( 'h1' , { } , metadata . name ) ) ;
}
}
}
}
const detail = getViewElem ( 'detail' ) ;
if ( metadata . about ) {
if ( metadata . about ) {
const detail = getViewElem ( ` detail- ${ pubkey } ` ) ;
if ( ! detail . children . length ) {
if ( ! detail . children . length ) {
const [ content ] = parseTextContent ( metadata . about ) ;
const [ content ] = parseTextContent ( metadata . about ) ;
detail ? . append ( . . . content ) ;
detail ? . append ( . . . content ) ;