mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-20 23:32:14 +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.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<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 { getClient } from '@hcengineering/presentation'
|
||||||
import activity, {
|
import activity, {
|
||||||
ActivityExtension,
|
ActivityExtension,
|
||||||
@ -27,8 +27,8 @@
|
|||||||
import { get } from 'svelte/store'
|
import { get } from 'svelte/store'
|
||||||
import { Scroller, ScrollParams } from '@hcengineering/ui'
|
import { Scroller, ScrollParams } from '@hcengineering/ui'
|
||||||
import {
|
import {
|
||||||
ActivityMessagePresenter,
|
ActivityExtension as ActivityExtensionComponent,
|
||||||
ActivityExtension as ActivityExtensionComponent
|
ActivityMessagePresenter
|
||||||
} from '@hcengineering/activity-resources'
|
} from '@hcengineering/activity-resources'
|
||||||
|
|
||||||
import ActivityMessagesSeparator from './ChannelMessagesSeparator.svelte'
|
import ActivityMessagesSeparator from './ChannelMessagesSeparator.svelte'
|
||||||
@ -293,20 +293,17 @@
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
const lastViewedMessageIdx = displayMessages.findIndex((message, index) => {
|
const me = getCurrentAccount()._id
|
||||||
const nextMessage = displayMessages[index + 1]
|
|
||||||
|
|
||||||
if (message.createdBy === getCurrentAccount()._id) {
|
return displayMessages.findIndex((message) => {
|
||||||
|
if (message.createdBy === me) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
const createdOn = message.createdOn ?? 0
|
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)
|
$: separatorPosition = getNewPosition(displayMessages, lastViewedTimestamp)
|
||||||
|
@ -13,11 +13,10 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { getCurrentAccount, Ref } from '@hcengineering/core'
|
||||||
import { Doc, getCurrentAccount, Ref } from '@hcengineering/core'
|
|
||||||
import notification, { DocNotifyContext } from '@hcengineering/notification'
|
import notification, { DocNotifyContext } from '@hcengineering/notification'
|
||||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
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 activity from '@hcengineering/activity'
|
||||||
import view from '@hcengineering/view'
|
import view from '@hcengineering/view'
|
||||||
import { getResource } from '@hcengineering/platform'
|
import { getResource } from '@hcengineering/platform'
|
||||||
@ -30,8 +29,6 @@
|
|||||||
export let selectedContextId: Ref<DocNotifyContext> | undefined = undefined
|
export let selectedContextId: Ref<DocNotifyContext> | undefined = undefined
|
||||||
export let model: ChatNavGroupModel
|
export let model: ChatNavGroupModel
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
const hierarchy = client.getHierarchy()
|
const hierarchy = client.getHierarchy()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user