mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-14 12:25:17 +00:00
UBERF-5323: fix new messages marker (#4614)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
2265d6f8d0
commit
71ae492316
@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { Class, Doc, Ref, isOtherDay, Timestamp, getCurrentAccount } from '@hcengineering/core'
|
||||
import { Class, Doc, getCurrentAccount, isOtherDay, Ref, Timestamp } from '@hcengineering/core'
|
||||
import { getClient } from '@hcengineering/presentation'
|
||||
import activity, {
|
||||
ActivityExtension,
|
||||
@ -27,8 +27,8 @@
|
||||
import { get } from 'svelte/store'
|
||||
import { Scroller, ScrollParams } from '@hcengineering/ui'
|
||||
import {
|
||||
ActivityMessagePresenter,
|
||||
ActivityExtension as ActivityExtensionComponent
|
||||
ActivityExtension as ActivityExtensionComponent,
|
||||
ActivityMessagePresenter
|
||||
} from '@hcengineering/activity-resources'
|
||||
|
||||
import ActivityMessagesSeparator from './ChannelMessagesSeparator.svelte'
|
||||
@ -293,20 +293,17 @@
|
||||
return 0
|
||||
}
|
||||
|
||||
const lastViewedMessageIdx = displayMessages.findIndex((message, index) => {
|
||||
const nextMessage = displayMessages[index + 1]
|
||||
const me = getCurrentAccount()._id
|
||||
|
||||
if (message.createdBy === getCurrentAccount()._id) {
|
||||
return displayMessages.findIndex((message) => {
|
||||
if (message.createdBy === me) {
|
||||
return false
|
||||
}
|
||||
|
||||
const createdOn = message.createdOn ?? 0
|
||||
const nextCreatedOn = nextMessage?.createdOn ?? 0
|
||||
|
||||
return lastViewedTimestamp >= createdOn && lastViewedTimestamp < nextCreatedOn
|
||||
return lastViewedTimestamp < createdOn
|
||||
})
|
||||
|
||||
return lastViewedMessageIdx !== -1 ? lastViewedMessageIdx + 1 : -1
|
||||
}
|
||||
|
||||
$: separatorPosition = getNewPosition(displayMessages, lastViewedTimestamp)
|
||||
|
@ -13,11 +13,10 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { Doc, getCurrentAccount, Ref } from '@hcengineering/core'
|
||||
import { getCurrentAccount, Ref } from '@hcengineering/core'
|
||||
import notification, { DocNotifyContext } from '@hcengineering/notification'
|
||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||
import { Action, IconAdd, Scroller, showPopup } from '@hcengineering/ui'
|
||||
import { Action, Scroller } from '@hcengineering/ui'
|
||||
import activity from '@hcengineering/activity'
|
||||
import view from '@hcengineering/view'
|
||||
import { getResource } from '@hcengineering/platform'
|
||||
@ -30,8 +29,6 @@
|
||||
export let selectedContextId: Ref<DocNotifyContext> | undefined = undefined
|
||||
export let model: ChatNavGroupModel
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
const client = getClient()
|
||||
const hierarchy = client.getHierarchy()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user