Load relay selections whenever we see a new pubkey
This commit is contained in:
parent
6ee4ac1a89
commit
084d8d931b
1 changed files with 4 additions and 5 deletions
|
|
@ -41,6 +41,7 @@
|
||||||
loginWithNip01,
|
loginWithNip01,
|
||||||
loginWithNip46,
|
loginWithNip46,
|
||||||
EventsStorageAdapter,
|
EventsStorageAdapter,
|
||||||
|
loadRelaySelections,
|
||||||
} from "@welshman/app"
|
} from "@welshman/app"
|
||||||
import * as lib from "@welshman/lib"
|
import * as lib from "@welshman/lib"
|
||||||
import * as util from "@welshman/util"
|
import * as util from "@welshman/util"
|
||||||
|
|
@ -168,12 +169,10 @@
|
||||||
const unwrapper = new TaskQueue<TrustedEvent>({batchSize: 10, processItem: ensureUnwrapped})
|
const unwrapper = new TaskQueue<TrustedEvent>({batchSize: 10, processItem: ensureUnwrapped})
|
||||||
|
|
||||||
repository.on("update", ({added}) => {
|
repository.on("update", ({added}) => {
|
||||||
if (!$canDecrypt) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const event of added) {
|
for (const event of added) {
|
||||||
if (event.kind === WRAP) {
|
loadRelaySelections(event.pubkey)
|
||||||
|
|
||||||
|
if ($canDecrypt && event.kind === WRAP) {
|
||||||
unwrapper.push(event)
|
unwrapper.push(event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue