feat: optimize notifications

This commit is contained in:
codytseng
2025-09-05 22:08:17 +08:00
parent 47e7a18f2e
commit 2855754648
26 changed files with 520 additions and 234 deletions

View File

@@ -164,7 +164,7 @@ class ClientService extends EventTarget {
})
})
)
this.dispatchEvent(new CustomEvent('eventPublished', { detail: event }))
this.emitNewEvent(event)
return result
} catch (error) {
if (error instanceof AggregateError) {
@@ -174,6 +174,10 @@ class ClientService extends EventTarget {
}
}
emitNewEvent(event: NEvent) {
this.dispatchEvent(new CustomEvent('newEvent', { detail: event }))
}
async signHttpAuth(url: string, method: string, description = '') {
if (!this.signer) {
throw new Error('Please login first to sign the event')