Improve feed loader, wait for db before executing reads/updates, make taskQueue subscribable, add race, rename auth methods, fix failed wasm verify, fix localhost urls

This commit is contained in:
Jon Staab
2025-04-09 15:39:07 -07:00
parent 1bcc57d695
commit 859f7fa68f
14 changed files with 155 additions and 32 deletions
+5 -4
View File
@@ -66,14 +66,15 @@ export const verifyEvent = (() => {
if (typeof WebAssembly === "object") {
initNostrWasm()
.then(setNostrWasm, noop)
.then(() => {
.then(nostrWasm => {
setNostrWasm(nostrWasm)
verify = verifyEventWasm
}, e => {
console.warn(e)
})
}
return (event: TrustedEvent) =>
event.sig && (event[verifiedSymbol] || verify(event as SignedEvent))
return (event: TrustedEvent) => Boolean(event.sig && verify(event as SignedEvent))
})()
export const isEventTemplate = (e: EventTemplate): e is EventTemplate =>
+2 -2
View File
@@ -33,8 +33,8 @@ export const isRelayUrl = (url: string) => {
// Skip urls with a slash before the dot
if (url.match(/\\.*\./)) return false
// Skip urls without a dot
if (!url.match(/\./)) return false
// Skip non-localhost urls without a dot
if (!url.match(/\./) && !url.includes('localhost')) return false
try {
new URL(url)