save only followDistance <= 2 evts to idb

This commit is contained in:
Martti Malmi 2024-01-03 17:38:01 +02:00
parent 6582b4c7d5
commit d187fbc6e5

View File

@ -129,7 +129,7 @@ System.on("auth", async (c, r, cb) => {
System.on("event", (_, ev) => {
addEventToFuzzySearch(ev);
socialGraphInstance.handleEvent(ev);
if (CONFIG.useIndexedDBEvents) {
if (CONFIG.useIndexedDBEvents && socialGraphInstance.getFollowDistance(ev.pubkey) <= 2) {
indexedDB.handleEvent(ev);
}
});