mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-28 10:57:36 +00:00
[UBERF-41] Chat notification fixes (#3630)
Signed-off-by: Oleg Solodkov <oleg.solodkov@xored.com>
This commit is contained in:
parent
2c585b2ecd
commit
3be2e0ea55
@ -105,11 +105,11 @@
|
||||
function newMessagesStart (messages: Message[], docUpdates: Map<Ref<Doc>, DocUpdates>): number {
|
||||
if (space === undefined) return -1
|
||||
const docUpdate = docUpdates.get(space)
|
||||
const lastView = docUpdate?.txes?.[0]?.modifiedOn
|
||||
const lastView = docUpdate?.txes?.findLast((tx) => !tx.isNew)
|
||||
if (docUpdate === undefined || lastView === undefined) return -1
|
||||
for (let index = 0; index < messages.length; index++) {
|
||||
const message = messages[index]
|
||||
if ((message.createdOn ?? 0) >= lastView) return index
|
||||
if ((message.createdOn ?? 0) >= lastView.modifiedOn) return index
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
@ -105,7 +105,7 @@
|
||||
function isChanged (space: Space, docUpdates: Map<Ref<Doc>, DocUpdates>): boolean {
|
||||
const update = docUpdates.get(space._id)
|
||||
if (update === undefined) return false
|
||||
return update.txes.length > 0 && update.hidden !== true
|
||||
return update.txes.filter((tx) => tx.isNew).length > 0 && update.hidden !== true
|
||||
}
|
||||
|
||||
function getParentActions (): Action[] {
|
||||
|
Loading…
Reference in New Issue
Block a user