mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 03:14:40 +03:00
Fix double notifications contexts (#5422)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
2bb4e8a074
commit
164db48358
3
.vscode/launch.json
vendored
3
.vscode/launch.json
vendored
@ -51,7 +51,8 @@
|
||||
// "SERVER_PROVIDER":"uweb"
|
||||
"SERVER_PROVIDER":"ws",
|
||||
"MODEL_VERSION": "",
|
||||
"ELASTIC_INDEX_NAME": "local_storage_index"
|
||||
"ELASTIC_INDEX_NAME": "local_storage_index",
|
||||
"UPLOAD_URL": "/files",
|
||||
|
||||
// "RETRANSLATE_URL": "http://127.0.0.1:4500",
|
||||
//"RETRANSLATE_URL": "https://208.167.249.201",
|
||||
|
@ -464,22 +464,22 @@ async function OnChannelMembersChanged (tx: TxUpdateDoc<Channel>, control: Trigg
|
||||
const context = allContexts.find(({ user }) => user === addedMember)
|
||||
|
||||
if (context === undefined) {
|
||||
res.push(
|
||||
control.txFactory.createTxCreateDoc(notification.class.DocNotifyContext, tx.objectSpace, {
|
||||
attachedTo: tx.objectId,
|
||||
attachedToClass: tx.objectClass,
|
||||
user: addedMember,
|
||||
hidden: false,
|
||||
lastViewedTimestamp: tx.modifiedOn
|
||||
})
|
||||
)
|
||||
const createTx = control.txFactory.createTxCreateDoc(notification.class.DocNotifyContext, tx.objectSpace, {
|
||||
attachedTo: tx.objectId,
|
||||
attachedToClass: tx.objectClass,
|
||||
user: addedMember,
|
||||
hidden: false,
|
||||
lastViewedTimestamp: tx.modifiedOn
|
||||
})
|
||||
|
||||
await control.apply([createTx], true)
|
||||
} else {
|
||||
res.push(
|
||||
control.txFactory.createTxUpdateDoc(context._class, context.space, context._id, {
|
||||
hidden: false,
|
||||
lastViewedTimestamp: tx.modifiedOn
|
||||
})
|
||||
)
|
||||
const updateTx = control.txFactory.createTxUpdateDoc(context._class, context.space, context._id, {
|
||||
hidden: false,
|
||||
lastViewedTimestamp: tx.modifiedOn
|
||||
})
|
||||
|
||||
await control.apply([updateTx], true)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -403,15 +403,14 @@ export async function pushInboxNotifications (
|
||||
hidden: false,
|
||||
lastUpdateTimestamp: shouldUpdateTimestamp ? modifiedOn : undefined
|
||||
})
|
||||
res.push(createContextTx)
|
||||
await control.apply([createContextTx], true)
|
||||
docNotifyContextId = createContextTx.objectId
|
||||
} else {
|
||||
if (shouldUpdateTimestamp) {
|
||||
res.push(
|
||||
control.txFactory.createTxUpdateDoc(context._class, context.space, context._id, {
|
||||
lastUpdateTimestamp: modifiedOn
|
||||
})
|
||||
)
|
||||
const updateTx = control.txFactory.createTxUpdateDoc(context._class, context.space, context._id, {
|
||||
lastUpdateTimestamp: modifiedOn
|
||||
})
|
||||
await control.apply([updateTx], true)
|
||||
}
|
||||
docNotifyContextId = context._id
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user