@ -82,7 +82,7 @@ const renderFeed = bounce(() => {
refreshFollowing ( view . id ) ;
refreshFollowing ( view . id ) ;
break ;
break ;
case 'home' :
case 'home' :
const ids = getOwnContacts( ) ;
const ids = view. id ? getContacts ( view . id ) : getOwnContacts( ) ;
[
[
. . . textNoteList
. . . textNoteList
. filter ( note = > ids . includes ( note . pubkey ) ) ,
. filter ( note = > ids . includes ( note . pubkey ) ) ,
@ -269,7 +269,7 @@ const route = (path: string) => {
const contactList = getOwnContacts ( ) ;
const contactList = getOwnContacts ( ) ;
if ( contactList . length ) {
if ( contactList . length ) {
subPubkeys ( contactList , onEvent ) ;
subPubkeys ( contactList , onEvent ) ;
view ( ` / ` , { type : 'home' } ) ;
view ( '/' , { type : 'home' } ) ;
} else {
} else {
subGlobalFeed ( onEvent ) ;
subGlobalFeed ( onEvent ) ;
view ( '/feed' , { type : 'feed' } ) ;
view ( '/feed' , { type : 'feed' } ) ;
@ -306,6 +306,14 @@ const route = (path: string) => {
subContactList ( contactPubkey , onEvent ) ;
subContactList ( contactPubkey , onEvent ) ;
view ( path , { type : 'contacts' , id : contactPubkey } ) ;
view ( path , { type : 'contacts' , id : contactPubkey } ) ;
}
}
} else if ( path . length === 73 && path . match ( /^\/timeline\/npub[0-9a-z]+$/ ) ) {
const timelineNpub = path . slice ( 10 ) ;
const { type : timelineType , data : timelinePubkey } = nip19 . decode ( timelineNpub ) ;
if ( timelineType === 'npub' ) {
const timelinePubkeys = getContacts ( timelinePubkey ) ;
subPubkeys ( timelinePubkeys , onEvent ) ;
view ( path , { type : 'home' , id : timelinePubkey } ) ;
}
} else if ( path . length === 65 ) {
} else if ( path . length === 65 ) {
const eventID = path . slice ( 1 ) ;
const eventID = path . slice ( 1 ) ;
subEventID ( eventID , onEventDetails ) ;
subEventID ( eventID , onEventDetails ) ;
@ -346,6 +354,7 @@ const handleLink = (a: HTMLAnchorElement, e: MouseEvent) => {
|| href . startsWith ( '/note' )
|| href . startsWith ( '/note' )
|| href . startsWith ( '/npub' )
|| href . startsWith ( '/npub' )
|| href . startsWith ( '/contacts/npub' )
|| href . startsWith ( '/contacts/npub' )
|| href . startsWith ( '/timeline/npub' )
|| ( href . startsWith ( '/' ) && href . length === 65 )
|| ( href . startsWith ( '/' ) && href . length === 65 )
) {
) {
route ( href ) ;
route ( href ) ;