show own posts in follows feed
This commit is contained in:
@ -27,10 +27,12 @@ export class FollowsFeedCache extends RefreshFeedCache<TaggedNostrEvent> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildSub(session: LoginSession, rb: RequestBuilder): void {
|
buildSub(session: LoginSession, rb: RequestBuilder): void {
|
||||||
|
const authors = session.follows.item;
|
||||||
|
authors.push(session.publicKey);
|
||||||
const since = this.newest();
|
const since = this.newest();
|
||||||
rb.withFilter()
|
rb.withFilter()
|
||||||
.kinds(this.#kinds)
|
.kinds(this.#kinds)
|
||||||
.authors(session.follows.item)
|
.authors(authors)
|
||||||
.since(since === 0 ? unixNow() - WindowSize : since);
|
.since(since === 0 ? unixNow() - WindowSize : since);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,9 +69,11 @@ export class FollowsFeedCache extends RefreshFeedCache<TaggedNostrEvent> {
|
|||||||
async loadMore(system: SystemInterface, session: LoginSession, before: number) {
|
async loadMore(system: SystemInterface, session: LoginSession, before: number) {
|
||||||
if (this.#oldest && before <= this.#oldest) {
|
if (this.#oldest && before <= this.#oldest) {
|
||||||
const rb = new RequestBuilder(`${this.name}-loadmore`);
|
const rb = new RequestBuilder(`${this.name}-loadmore`);
|
||||||
|
const authors = session.follows.item;
|
||||||
|
authors.push(session.publicKey);
|
||||||
rb.withFilter()
|
rb.withFilter()
|
||||||
.kinds(this.#kinds)
|
.kinds(this.#kinds)
|
||||||
.authors(session.follows.item)
|
.authors(authors)
|
||||||
.until(before)
|
.until(before)
|
||||||
.since(before - WindowSize);
|
.since(before - WindowSize);
|
||||||
await system.Fetch(rb, async evs => {
|
await system.Fetch(rb, async evs => {
|
||||||
|
@ -6,9 +6,17 @@ import { ErrorOrOffline } from "./ErrorOrOffline";
|
|||||||
import { HashTagHeader } from "@/Pages/HashTagsPage";
|
import { HashTagHeader } from "@/Pages/HashTagsPage";
|
||||||
import { useLocale } from "@/IntlProvider";
|
import { useLocale } from "@/IntlProvider";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import {Link} from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
export default function TrendingHashtags({ title, count = Infinity, short }: { title?: ReactNode; count?: number, short?: boolean }) {
|
export default function TrendingHashtags({
|
||||||
|
title,
|
||||||
|
count = Infinity,
|
||||||
|
short,
|
||||||
|
}: {
|
||||||
|
title?: ReactNode;
|
||||||
|
count?: number;
|
||||||
|
short?: boolean;
|
||||||
|
}) {
|
||||||
const [hashtags, setHashtags] = useState<Array<{ hashtag: string; posts: number }>>();
|
const [hashtags, setHashtags] = useState<Array<{ hashtag: string; posts: number }>>();
|
||||||
const [error, setError] = useState<Error>();
|
const [error, setError] = useState<Error>();
|
||||||
const { lang } = useLocale();
|
const { lang } = useLocale();
|
||||||
@ -44,9 +52,7 @@ export default function TrendingHashtags({ title, count = Infinity, short }: { t
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (
|
return <HashTagHeader tag={a.hashtag} events={a.posts} className={classNames("bb", { p: !short })} />;
|
||||||
<HashTagHeader tag={a.hashtag} events={a.posts} className={classNames("bb", { p: !short })} />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</>
|
</>
|
||||||
|
Reference in New Issue
Block a user