mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-29 21:15:06 +02:00
Cache providers for common notifications (#11047)
Signed-off-by: Artyom Savchenko <armisav@gmail.com>
This commit is contained in:
@@ -115,7 +115,7 @@ export async function getCommonNotificationTxes (
|
||||
const res: Tx[] = []
|
||||
const notifyContexts = await control.findAll(ctx, notification.class.DocNotifyContext, { objectId: attachedTo })
|
||||
|
||||
await pushInboxNotifications(
|
||||
const notificationTx = await pushInboxNotifications(
|
||||
ctx,
|
||||
control,
|
||||
res,
|
||||
@@ -133,6 +133,13 @@ export async function getCommonNotificationTxes (
|
||||
tx
|
||||
)
|
||||
|
||||
if (notificationTx !== undefined) {
|
||||
const availableProviders: AvailableProvidersCache =
|
||||
control.contextCache.get(AvailableProvidersCacheKey) ?? new Map()
|
||||
availableProviders.set(notificationTx.objectId, Array.from(notifyResult.keys()))
|
||||
control.contextCache.set(AvailableProvidersCacheKey, availableProviders)
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user