mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-08 18:57:42 +02:00
Fix messages loading (#8865)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Generated
+518
-585
File diff suppressed because it is too large
Load Diff
@@ -43,9 +43,9 @@
|
||||
"@hcengineering/analytics": "^0.6.0",
|
||||
"@hcengineering/client": "^0.6.18",
|
||||
"@hcengineering/collaborator-client": "^0.6.4",
|
||||
"@hcengineering/communication-client-query": "0.1.174",
|
||||
"@hcengineering/communication-sdk-types": "0.1.174",
|
||||
"@hcengineering/communication-types": "0.1.174",
|
||||
"@hcengineering/communication-client-query": "0.1.175",
|
||||
"@hcengineering/communication-sdk-types": "0.1.175",
|
||||
"@hcengineering/communication-types": "0.1.175",
|
||||
"@hcengineering/core": "^0.6.32",
|
||||
"@hcengineering/diffview": "^0.6.0",
|
||||
"@hcengineering/notification": "^0.6.23",
|
||||
|
||||
@@ -65,12 +65,14 @@ import {
|
||||
createNotificationContextsQuery,
|
||||
createNotificationsQuery,
|
||||
createLabelsQuery,
|
||||
initLiveQueries
|
||||
initLiveQueries,
|
||||
type MessageQueryParams
|
||||
} from '@hcengineering/communication-client-query'
|
||||
|
||||
import { getCurrentWorkspaceUuid, getFilesUrl } from './file'
|
||||
|
||||
export { createMessagesQuery, createNotificationsQuery, createNotificationContextsQuery, createLabelsQuery }
|
||||
export type { MessageQueryParams }
|
||||
|
||||
interface Connection extends PlatformConnection {
|
||||
findMessages: (params: FindMessagesParams, queryId?: number) => Promise<Message[]>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
"@hcengineering/analytics": "^0.6.0",
|
||||
"@hcengineering/attachment-resources": "^0.6.0",
|
||||
"@hcengineering/card": "^0.6.0",
|
||||
"@hcengineering/communication-types": "0.1.174",
|
||||
"@hcengineering/communication-types": "0.1.175",
|
||||
"@hcengineering/contact": "^0.6.24",
|
||||
"@hcengineering/contact-resources": "^0.6.0",
|
||||
"@hcengineering/core": "^0.6.32",
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
"@hcengineering/ui-next": "^0.6.0",
|
||||
"@hcengineering/view": "^0.6.13",
|
||||
"@hcengineering/view-resources": "^0.6.0",
|
||||
"@hcengineering/communication-types": "0.1.174",
|
||||
"@hcengineering/communication-types": "0.1.175",
|
||||
"svelte": "^4.2.19"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
"dependencies": {
|
||||
"@hcengineering/presence": "^0.6.0",
|
||||
"@hcengineering/presentation": "^0.6.3",
|
||||
"@hcengineering/communication-types": "0.1.174",
|
||||
"@hcengineering/communication-types": "0.1.175",
|
||||
"@hcengineering/core": "^0.6.32",
|
||||
"@hcengineering/ui": "^0.6.15",
|
||||
"@hcengineering/setting": "^0.6.17",
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
"@hcengineering/card": "^0.6.0",
|
||||
"@hcengineering/card-resources": "^0.6.0",
|
||||
"@hcengineering/chat": "^0.6.0",
|
||||
"@hcengineering/communication-types": "0.1.174",
|
||||
"@hcengineering/communication-types": "0.1.175",
|
||||
"@hcengineering/contact": "^0.6.24",
|
||||
"@hcengineering/contact-resources": "^0.6.0",
|
||||
"@hcengineering/core": "^0.6.32",
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
"dependencies": {
|
||||
"@hcengineering/analytics": "^0.6.0",
|
||||
"@hcengineering/client": "^0.6.18",
|
||||
"@hcengineering/communication-sdk-types": "0.1.174",
|
||||
"@hcengineering/communication-types": "0.1.174",
|
||||
"@hcengineering/communication-sdk-types": "0.1.175",
|
||||
"@hcengineering/communication-types": "0.1.175",
|
||||
"@hcengineering/core": "^0.6.32",
|
||||
"@hcengineering/platform": "^0.6.11",
|
||||
"@hcengineering/rpc": "^0.6.5",
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
"dependencies": {
|
||||
"@hcengineering/card": "^0.6.0",
|
||||
"@hcengineering/communication": "^0.6.0",
|
||||
"@hcengineering/communication-types": "0.1.174",
|
||||
"@hcengineering/communication-types": "0.1.175",
|
||||
"@hcengineering/core": "^0.6.32",
|
||||
"@hcengineering/platform": "^0.6.11",
|
||||
"@hcengineering/presentation": "^0.6.3",
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
context={notificationContext}
|
||||
{scrollDiv}
|
||||
{contentDiv}
|
||||
{position}
|
||||
bind:position
|
||||
shouldScrollToStart={active && position === MessagesNavigationAnchors.ConversationStart && shouldScrollToStart}
|
||||
{isLoadingBefore}
|
||||
on:change
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { Card } from '@hcengineering/card'
|
||||
import { FindMessagesParams, type Message, NotificationContext, Window } from '@hcengineering/communication-types'
|
||||
import { createMessagesQuery, getCommunicationClient } from '@hcengineering/presentation'
|
||||
import { type Message, NotificationContext, Window } from '@hcengineering/communication-types'
|
||||
import { createMessagesQuery, getCommunicationClient, type MessageQueryParams } from '@hcengineering/presentation'
|
||||
import { getCurrentAccount, SortingOrder } from '@hcengineering/core'
|
||||
import { createEventDispatcher, onDestroy, onMount, tick } from 'svelte'
|
||||
import { MessagesGroup as MessagesGroupPresenter, MessagesLoading } from '@hcengineering/ui-next'
|
||||
@@ -36,7 +36,6 @@
|
||||
const communicationClient = getCommunicationClient()
|
||||
const query = createMessagesQuery()
|
||||
|
||||
const loadPageThreshold = 200
|
||||
const scrollToNewThreshold = 50
|
||||
|
||||
const initialLastView = context?.lastView
|
||||
@@ -117,7 +116,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
function getBaseQuery (): FindMessagesParams {
|
||||
function getBaseQuery (): MessageQueryParams {
|
||||
if (position === MessagesNavigationAnchors.ConversationStart) {
|
||||
return {
|
||||
card: card._id,
|
||||
@@ -136,12 +135,7 @@
|
||||
reactions: true,
|
||||
order,
|
||||
limit,
|
||||
created:
|
||||
unread && initialLastView != null
|
||||
? {
|
||||
greaterOrEqual: initialLastView
|
||||
}
|
||||
: undefined
|
||||
from: unread && initialLastView != null ? initialLastView : undefined
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,11 +162,11 @@
|
||||
function shouldLoadPrevPage (): boolean {
|
||||
const topOffset = getTopOffset()
|
||||
|
||||
return topOffset > -1 && topOffset <= loadPageThreshold
|
||||
return topOffset > -1 && topOffset <= 300
|
||||
}
|
||||
|
||||
function shouldLoadNextPage (): boolean {
|
||||
return getBottomOffset() <= loadPageThreshold
|
||||
return getBottomOffset() <= 200
|
||||
}
|
||||
|
||||
function loadMore (): void {
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
"dependencies": {
|
||||
"@hcengineering/analytics": "^0.6.0",
|
||||
"@hcengineering/card": "^0.6.0",
|
||||
"@hcengineering/communication-types": "0.1.174",
|
||||
"@hcengineering/communication-types": "0.1.175",
|
||||
"@hcengineering/contact": "^0.6.24",
|
||||
"@hcengineering/contact-resources": "^0.6.0",
|
||||
"@hcengineering/core": "^0.6.32",
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
"dependencies": {
|
||||
"@hcengineering/analytics": "^0.6.0",
|
||||
"@hcengineering/analytics-service": "^0.6.0",
|
||||
"@hcengineering/communication-server": "0.1.174",
|
||||
"@hcengineering/communication-server": "0.1.175",
|
||||
"@hcengineering/contact": "^0.6.24",
|
||||
"@hcengineering/core": "^0.6.32",
|
||||
"@hcengineering/kafka": "^0.6.0",
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
"@hcengineering/server-core": "^0.6.1",
|
||||
"@hcengineering/server-notification-resources": "^0.6.0",
|
||||
"@hcengineering/text-core": "^0.6.0",
|
||||
"@hcengineering/communication-sdk-types": "0.1.174",
|
||||
"@hcengineering/communication-types": "0.1.174"
|
||||
"@hcengineering/communication-sdk-types": "0.1.175",
|
||||
"@hcengineering/communication-types": "0.1.175"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
"@hcengineering/core": "^0.6.32",
|
||||
"@hcengineering/platform": "^0.6.11",
|
||||
"@hcengineering/server-core": "^0.6.1",
|
||||
"@hcengineering/communication-sdk-types": "0.1.174",
|
||||
"@hcengineering/communication-sdk-types": "0.1.175",
|
||||
"@hcengineering/server-contact": "^0.6.1",
|
||||
"@hcengineering/contact": "^0.6.24"
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@hcengineering/analytics": "^0.6.0",
|
||||
"@hcengineering/communication-sdk-types": "0.1.174",
|
||||
"@hcengineering/communication-types": "0.1.174",
|
||||
"@hcengineering/communication-sdk-types": "0.1.175",
|
||||
"@hcengineering/communication-types": "0.1.175",
|
||||
"@hcengineering/core": "^0.6.32",
|
||||
"@hcengineering/platform": "^0.6.11",
|
||||
"@hcengineering/query": "^0.6.12",
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
"dependencies": {
|
||||
"@hcengineering/account-client": "^0.6.0",
|
||||
"@hcengineering/analytics": "^0.6.0",
|
||||
"@hcengineering/communication-types": "0.1.174",
|
||||
"@hcengineering/communication-sdk-types": "0.1.174",
|
||||
"@hcengineering/communication-types": "0.1.175",
|
||||
"@hcengineering/communication-sdk-types": "0.1.175",
|
||||
"@hcengineering/core": "^0.6.32",
|
||||
"@hcengineering/platform": "^0.6.11",
|
||||
"@hcengineering/rpc": "^0.6.5",
|
||||
|
||||
@@ -61,8 +61,8 @@
|
||||
"@hcengineering/analytics-service": "^0.6.0",
|
||||
"@hcengineering/api-client": "^0.6.0",
|
||||
"@hcengineering/card": "^0.6.0",
|
||||
"@hcengineering/communication-rest-client": "0.1.174",
|
||||
"@hcengineering/communication-types": "0.1.174",
|
||||
"@hcengineering/communication-rest-client": "0.1.175",
|
||||
"@hcengineering/communication-types": "0.1.175",
|
||||
"@hcengineering/contact": "^0.6.24",
|
||||
"@hcengineering/core": "^0.6.32",
|
||||
"@hcengineering/mail": "^0.6.0",
|
||||
|
||||
@@ -57,11 +57,11 @@
|
||||
"dependencies": {
|
||||
"@hcengineering/api-client": "^0.6.0",
|
||||
"@hcengineering/card": "^0.6.0",
|
||||
"@hcengineering/communication-types": "0.1.174",
|
||||
"@hcengineering/communication-shared": "0.1.174",
|
||||
"@hcengineering/communication-yaml": "0.1.174",
|
||||
"@hcengineering/communication-sdk-types": "0.1.174",
|
||||
"@hcengineering/communication-rest-client": "0.1.174",
|
||||
"@hcengineering/communication-types": "0.1.175",
|
||||
"@hcengineering/communication-shared": "0.1.175",
|
||||
"@hcengineering/communication-yaml": "0.1.175",
|
||||
"@hcengineering/communication-sdk-types": "0.1.175",
|
||||
"@hcengineering/communication-rest-client": "0.1.175",
|
||||
"@hcengineering/core": "^0.6.32",
|
||||
"@hcengineering/platform": "^0.6.11",
|
||||
"@hcengineering/server-client": "^0.6.0",
|
||||
|
||||
Reference in New Issue
Block a user