Compare commits

..

No commits in common. 'bb8790e9490deac340a7063769e59da552cd5474' and 'fea8c0bd21811ea17eb1b2ed2130e229a1e0f28d' have entirely different histories.

@ -66,14 +66,13 @@ const updateFollowing = (evt: Event) => {
case 'profile':
updateFollowBtn(view.id);
if (view.id === evt.pubkey) {
const npub = nip19.npubEncode(evt.pubkey);
// update following link
const following = getViewElem('following') as HTMLElement;
if (following) {
const count = evt.tags.filter(isPTag).length;
const anchor = elem('a', {
data: {following: evt.pubkey},
href: `/contacts/${npub}`,
href: `/contacts/${nip19.npubEncode(evt.pubkey)}`,
title: dateTime.format(evt.created_at * 1000),
}, [
'following ',
@ -82,12 +81,6 @@ const updateFollowing = (evt: Event) => {
following.replaceWith(anchor);
setViewElem('following', anchor);
}
let timeline = getViewElem('timeline');
if (!timeline) {
timeline = elem('a', {href: `/timeline/${npub}`}, 'timeline');
getViewElem('header').querySelector('footer')?.append(timeline);
setViewElem('timeline', timeline);
}
}
break;
}

@ -82,7 +82,7 @@ const renderFeed = bounce(() => {
refreshFollowing(view.id);
break;
case 'home':
const ids = view.id ? getContacts(view.id) : getOwnContacts();
const ids = getOwnContacts();
[
...textNoteList
.filter(note => ids.includes(note.pubkey)),
@ -269,7 +269,7 @@ const route = (path: string) => {
const contactList = getOwnContacts();
if (contactList.length) {
subPubkeys(contactList, onEvent);
view('/', {type: 'home'});
view(`/`, {type: 'home'});
} else {
subGlobalFeed(onEvent);
view('/feed', {type: 'feed'});
@ -306,14 +306,6 @@ const route = (path: string) => {
subContactList(contactPubkey, onEvent);
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) {
const eventID = path.slice(1);
subEventID(eventID, onEventDetails);
@ -354,7 +346,6 @@ const handleLink = (a: HTMLAnchorElement, e: MouseEvent) => {
|| href.startsWith('/note')
|| href.startsWith('/npub')
|| href.startsWith('/contacts/npub')
|| href.startsWith('/timeline/npub')
|| (href.startsWith('/') && href.length === 65)
) {
route(href);

@ -130,6 +130,7 @@ export const renderProfile = (pubkey: string) => {
header.append(elem('h1', {}, metadata.name));
}
}
console.log('render detail')
const detail = getViewElem(`detail-${pubkey}`);
if (metadata.about && !detail.children.length) {
const [content] = parseTextContent(metadata.about);

@ -193,8 +193,6 @@ nav a {
}
.hero footer {
display: flex;
gap: var(--gap-half);
padding-left: var(--extra-space);
}

@ -8,7 +8,6 @@ export type DOMMap = {
export type ViewTemplateOptions = {
type: 'home';
id?: string;
} | {
type: 'feed';
} | {

Loading…
Cancel
Save