fix: load social graph for follows only
This commit is contained in:
parent
69f6694f5c
commit
c39811e700
@ -60,7 +60,7 @@ async function initSite() {
|
||||
|
||||
const login = LoginStore.snapshot();
|
||||
preload(login.state.follows).then(async () => {
|
||||
await System.PreloadSocialGraph();
|
||||
await System.PreloadSocialGraph(login.state.follows);
|
||||
|
||||
for (const ev of UserCache.snapshot()) {
|
||||
try {
|
||||
|
@ -131,13 +131,14 @@ export class NostrSystem extends SystemBase implements SystemInterface {
|
||||
this.userFollowsCache.preload(follows),
|
||||
];
|
||||
await Promise.all(t);
|
||||
await this.PreloadSocialGraph();
|
||||
await this.PreloadSocialGraph(follows);
|
||||
}
|
||||
|
||||
async PreloadSocialGraph() {
|
||||
async PreloadSocialGraph(follows?: Array<string>) {
|
||||
// Insert data to socialGraph from cache
|
||||
if (this.config.buildFollowGraph) {
|
||||
for (const list of this.userFollowsCache.snapshot()) {
|
||||
if (follows && !follows.includes(list.pubkey)) continue;
|
||||
const user = ID(list.pubkey);
|
||||
for (const fx of list.follows) {
|
||||
if (fx[0] === "p" && fx[1]?.length === 64) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user