mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-17 05:47:32 +00: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":"uweb"
|
||||||
"SERVER_PROVIDER":"ws",
|
"SERVER_PROVIDER":"ws",
|
||||||
"MODEL_VERSION": "",
|
"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": "http://127.0.0.1:4500",
|
||||||
//"RETRANSLATE_URL": "https://208.167.249.201",
|
//"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)
|
const context = allContexts.find(({ user }) => user === addedMember)
|
||||||
|
|
||||||
if (context === undefined) {
|
if (context === undefined) {
|
||||||
res.push(
|
const createTx = control.txFactory.createTxCreateDoc(notification.class.DocNotifyContext, tx.objectSpace, {
|
||||||
control.txFactory.createTxCreateDoc(notification.class.DocNotifyContext, tx.objectSpace, {
|
|
||||||
attachedTo: tx.objectId,
|
attachedTo: tx.objectId,
|
||||||
attachedToClass: tx.objectClass,
|
attachedToClass: tx.objectClass,
|
||||||
user: addedMember,
|
user: addedMember,
|
||||||
hidden: false,
|
hidden: false,
|
||||||
lastViewedTimestamp: tx.modifiedOn
|
lastViewedTimestamp: tx.modifiedOn
|
||||||
})
|
})
|
||||||
)
|
|
||||||
|
await control.apply([createTx], true)
|
||||||
} else {
|
} else {
|
||||||
res.push(
|
const updateTx = control.txFactory.createTxUpdateDoc(context._class, context.space, context._id, {
|
||||||
control.txFactory.createTxUpdateDoc(context._class, context.space, context._id, {
|
|
||||||
hidden: false,
|
hidden: false,
|
||||||
lastViewedTimestamp: tx.modifiedOn
|
lastViewedTimestamp: tx.modifiedOn
|
||||||
})
|
})
|
||||||
)
|
|
||||||
|
await control.apply([updateTx], true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -403,15 +403,14 @@ export async function pushInboxNotifications (
|
|||||||
hidden: false,
|
hidden: false,
|
||||||
lastUpdateTimestamp: shouldUpdateTimestamp ? modifiedOn : undefined
|
lastUpdateTimestamp: shouldUpdateTimestamp ? modifiedOn : undefined
|
||||||
})
|
})
|
||||||
res.push(createContextTx)
|
await control.apply([createContextTx], true)
|
||||||
docNotifyContextId = createContextTx.objectId
|
docNotifyContextId = createContextTx.objectId
|
||||||
} else {
|
} else {
|
||||||
if (shouldUpdateTimestamp) {
|
if (shouldUpdateTimestamp) {
|
||||||
res.push(
|
const updateTx = control.txFactory.createTxUpdateDoc(context._class, context.space, context._id, {
|
||||||
control.txFactory.createTxUpdateDoc(context._class, context.space, context._id, {
|
|
||||||
lastUpdateTimestamp: modifiedOn
|
lastUpdateTimestamp: modifiedOn
|
||||||
})
|
})
|
||||||
)
|
await control.apply([updateTx], true)
|
||||||
}
|
}
|
||||||
docNotifyContextId = context._id
|
docNotifyContextId = context._id
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user