AdminStore: fix users check
This commit is contained in:
parent
d1ba797c93
commit
e7ed3c839c
|
@ -14,12 +14,13 @@ export class AdminStore implements NStore {
|
||||||
|
|
||||||
async query(filters: NostrFilter[], opts: { signal?: AbortSignal; limit?: number } = {}): Promise<DittoEvent[]> {
|
async query(filters: NostrFilter[], opts: { signal?: AbortSignal; limit?: number } = {}): Promise<DittoEvent[]> {
|
||||||
const events = await this.store.query(filters, opts);
|
const events = await this.store.query(filters, opts);
|
||||||
|
const pubkeys = new Set(events.map((event) => event.pubkey));
|
||||||
|
|
||||||
const users = await this.store.query([{
|
const users = await this.store.query([{
|
||||||
kinds: [30382],
|
kinds: [30382],
|
||||||
authors: [Conf.pubkey],
|
authors: [Conf.pubkey],
|
||||||
'#d': events.map((event) => event.pubkey),
|
'#d': [...pubkeys],
|
||||||
limit: 1,
|
limit: pubkeys.size,
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return events.filter((event) => {
|
return events.filter((event) => {
|
||||||
|
|
Loading…
Reference in New Issue