add profile events from db to fuzzy search
This commit is contained in:
parent
8fb127b347
commit
08bfd38563
@ -12,6 +12,7 @@ import { initRelayWorker, preload, Relay } from "@/Cache";
|
||||
import { ThreadRoute } from "@/Components/Event/Thread";
|
||||
import { IntlProvider } from "@/Components/IntlProvider/IntlProvider";
|
||||
import { db } from "@/Db";
|
||||
import { addEventToFuzzySearch } from "@/Db/FuzzySearch";
|
||||
import { updateRelayConnections } from "@/Hooks/useLoginRelays";
|
||||
import { AboutPage } from "@/Pages/About";
|
||||
import { SnortDeckLayout } from "@/Pages/DeckLayout";
|
||||
@ -71,7 +72,20 @@ async function initSite() {
|
||||
setupWebLNWalletConfig(Wallets);
|
||||
Relay.sql("select json from events where kind = ?", [3]).then(res => {
|
||||
for (const [json] of res) {
|
||||
socialGraphInstance.handleEvent(JSON.parse(json as string));
|
||||
try {
|
||||
socialGraphInstance.handleEvent(JSON.parse(json as string));
|
||||
} catch (e) {
|
||||
console.error("Failed to handle contact list event from sql db", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
Relay.sql("select json from events where kind = ?", [0]).then(res => {
|
||||
for (const [json] of res) {
|
||||
try {
|
||||
addEventToFuzzySearch(JSON.parse(json as string));
|
||||
} catch (e) {
|
||||
console.error("Failed to handle metadata event from sql db", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
return null;
|
||||
|
@ -3,6 +3,7 @@ import { mapEventToProfile, NostrEvent, NostrSystem, ProfileLoaderService, socia
|
||||
import inMemoryDB from "@snort/system/src/InMemoryDB";
|
||||
|
||||
import { EventsCache, Relay, RelayMetrics, SystemDb, UserCache, UserRelays } from "@/Cache";
|
||||
import { addEventToFuzzySearch } from "@/Db/FuzzySearch";
|
||||
import { LoginStore } from "@/Utils/Login";
|
||||
import { hasWasm, WasmOptimizer } from "@/Utils/wasm";
|
||||
|
||||
@ -32,6 +33,7 @@ System.on("event", (_, ev) => {
|
||||
UserCache.discover(ev);
|
||||
inMemoryDB.handleEvent(ev);
|
||||
socialGraphInstance.handleEvent(ev);
|
||||
addEventToFuzzySearch(ev);
|
||||
});
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user