mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 03:14:40 +03:00
Fix double tx apply with needResult true (#6585)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
9583f57cf0
commit
ec6b6fb568
@ -60,13 +60,13 @@ export async function OnReactionChanged (originTx: Tx, control: TriggerControl):
|
||||
if (innerTx._class === core.class.TxCreateDoc) {
|
||||
const txes = await createReactionNotifications(tx, control)
|
||||
|
||||
await control.apply(control.ctx, txes, true)
|
||||
await control.apply(control.ctx, txes)
|
||||
return []
|
||||
}
|
||||
|
||||
if (innerTx._class === core.class.TxRemoveDoc) {
|
||||
const txes = await removeReactionNotifications(tx, control)
|
||||
await control.apply(control.ctx, txes, true)
|
||||
await control.apply(control.ctx, txes)
|
||||
return []
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,9 @@ export class Triggers {
|
||||
ctx,
|
||||
txFactory: null as any, // Will be set later
|
||||
apply: async (ctx, tx, needResult) => {
|
||||
if (needResult !== true) {
|
||||
apply.push(...tx)
|
||||
}
|
||||
ctrl.txes.push(...tx) // We need to put them so other triggers could check if similar operation is already performed.
|
||||
return await ctrl.apply(ctx, tx, needResult)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user