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