mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 04:25:03 +02:00
UBER-902: Fix transactions (#3748)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -428,8 +428,19 @@ async function isShouldNotify (
|
||||
let allowed = false
|
||||
const emailTypes: NotificationType[] = []
|
||||
const types = await getMatchedTypes(control, tx, originTx, isOwn, isSpace)
|
||||
|
||||
const personAccount = await getPersonAccountById(user, control)
|
||||
|
||||
for (const type of types) {
|
||||
if (type.allowedForAuthor !== true && tx.modifiedBy === user) continue
|
||||
const modifiedAccount = await getPersonAccountById(tx.modifiedBy, control)
|
||||
if (
|
||||
type.allowedForAuthor !== true &&
|
||||
(tx.modifiedBy === user ||
|
||||
// Also check if we have different account for same user.
|
||||
(personAccount?.person !== undefined && personAccount?.person === modifiedAccount?.person))
|
||||
) {
|
||||
continue
|
||||
}
|
||||
if (control.hierarchy.hasMixin(type, serverNotification.mixin.TypeMatch)) {
|
||||
const mixin = control.hierarchy.as(type, serverNotification.mixin.TypeMatch)
|
||||
if (mixin.func !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user