dont save p tags for now
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Martti Malmi 2024-01-04 00:03:17 +02:00
parent 2fa75e8e3d
commit 267c09a946
3 changed files with 10 additions and 9 deletions

View File

@ -76,10 +76,11 @@ class IndexedDB extends Dexie {
return true; return true;
} }
// we're only interested in p tags where we are mentioned // we're only interested in p tags where we are mentioned
/*
if (tag[0] === "p") { if (tag[0] === "p") {
// && Key.isMine(tag[1])) { Key.isMine(tag[1])) { // TODO
return true; return true;
} }*/
return false; return false;
}) })
.map(tag => ({ .map(tag => ({
@ -140,10 +141,7 @@ class IndexedDB extends Dexie {
const [author, kind] = pair.split("|"); const [author, kind] = pair.split("|");
return [author, parseInt(kind)]; return [author, parseInt(kind)];
}); });
await this.events await this.events.where("[pubkey+kind]").anyOf(pairs).each(callback);
.where("[pubkey+kind]")
.anyOf(pairs)
.each(callback);
}, 200); }, 200);
async find(filter: Filter, callback: (event: TaggedNostrEvent) => void): Promise<void> { async find(filter: Filter, callback: (event: TaggedNostrEvent) => void): Promise<void> {
@ -153,7 +151,7 @@ class IndexedDB extends Dexie {
const cb = e => { const cb = e => {
this.seenEvents.add(e.id); this.seenEvents.add(e.id);
callback(e); callback(e);
} };
if (filter["#p"] && Array.isArray(filter["#p"])) { if (filter["#p"] && Array.isArray(filter["#p"])) {
for (const eventId of filter["#p"]) { for (const eventId of filter["#p"]) {

View File

@ -136,7 +136,10 @@ System.on("event", (_, ev) => {
if (CONFIG.useIndexedDBEvents) { if (CONFIG.useIndexedDBEvents) {
// load all profiles // load all profiles
indexedDB.find({ kinds: [0] }, Comlink.proxy((e: TaggedNostrEvent) => System.HandleEvent(e))); indexedDB.find(
{ kinds: [0] },
Comlink.proxy((e: TaggedNostrEvent) => System.HandleEvent(e)),
);
System.on("request", (filter: ReqFilter) => { System.on("request", (filter: ReqFilter) => {
indexedDB.find( indexedDB.find(