This commit is contained in:
Shusui MOYATANI
2023-05-14 14:41:25 +09:00
parent 1b15989faf
commit 88cc1c9bc8
3 changed files with 27 additions and 4 deletions

View File

@@ -60,6 +60,9 @@ const extract = (parsed: ParsedTextNote) => {
} else if (node.data.type === 'note') {
eventReferences.push(node.data.data);
}
// TODO nevent can contain an event not only textnote (kind:1).
// In my understanding, it is not allowed to include other kinds of events in `tags`.
// It is needed to verify that the kind of the event is 1.
}
});

View File

@@ -1,4 +1,4 @@
import { Component } from 'solid-js';
import { Component, createEffect, onCleanup, onMount } from 'solid-js';
import Home from 'heroicons/24/outline/home.svg';
import { uniq } from 'lodash';
@@ -25,7 +25,7 @@ const FollowingColumn: Component<FollowingColumnDisplayProps> = (props) => {
const { followingPubkeys } = useFollowings(() => ({ pubkey: props.column.pubkey }));
const { events: followingsPosts } = useSubscription(() => {
const { events } = useSubscription(() => {
const authors = uniq([...followingPubkeys()]);
if (authors.length === 0) return null;
return {
@@ -45,6 +45,13 @@ const FollowingColumn: Component<FollowingColumnDisplayProps> = (props) => {
};
});
createEffect(() => {
console.log('home', events());
});
onMount(() => console.log('home timeline mounted'));
onCleanup(() => console.log('home timeline unmounted'));
return (
<Column
header={
@@ -59,7 +66,7 @@ const FollowingColumn: Component<FollowingColumnDisplayProps> = (props) => {
columnIndex={props.columnIndex}
lastColumn={props.lastColumn}
>
<Timeline events={followingsPosts()} />
<Timeline events={events()} />
</Column>
);
};