feat: optimize notifications
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user