From a06c129c60b2e0b61f27abab4988e288a1059afe Mon Sep 17 00:00:00 2001 From: Pavel Meyer Date: Mon, 27 Nov 2023 12:30:18 +0300 Subject: [PATCH] CW-2196 Fix PR comments --- src/services/DiscussionMessage.ts | 10 ++++++++-- src/shared/hooks/useCases/useDiscussionMessagesById.ts | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/services/DiscussionMessage.ts b/src/services/DiscussionMessage.ts index 46be7f995c..459ad6d596 100644 --- a/src/services/DiscussionMessage.ts +++ b/src/services/DiscussionMessage.ts @@ -30,7 +30,10 @@ class DiscussionMessageService { discussionId: string, lastVisible: firebase.firestore.QueryDocumentSnapshot | null, endDate: Date - ): Promise<{ data: DiscussionMessage[], lastVisibleSnapshot: firebase.firestore.QueryDocumentSnapshot }> => { + ): Promise<{ + data: DiscussionMessage[], + lastVisibleSnapshot: firebase.firestore.QueryDocumentSnapshot + }> => { const snapshot = await this.getDiscussionMessageCollection().where( "discussionId", "==", @@ -51,7 +54,10 @@ class DiscussionMessageService { .get(); const dataAfterEndDate = transformFirebaseDataList(snapshotOfItemsAfterEndDate); - return { data: [...data, ...dataAfterEndDate], lastVisibleSnapshot: snapshotOfItemsAfterEndDate.docs[dataAfterEndDate.length - 1] }; + return { + data: [...data, ...dataAfterEndDate], + lastVisibleSnapshot: snapshotOfItemsAfterEndDate.docs[dataAfterEndDate.length - 1] + }; } public getDiscussionMessagesByDiscussionId = (discussionId: string, diff --git a/src/shared/hooks/useCases/useDiscussionMessagesById.ts b/src/shared/hooks/useCases/useDiscussionMessagesById.ts index 7416e674d2..030ea26cc6 100644 --- a/src/shared/hooks/useCases/useDiscussionMessagesById.ts +++ b/src/shared/hooks/useCases/useDiscussionMessagesById.ts @@ -1,5 +1,6 @@ import { useEffect, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; +import { useUpdateEffect } from "react-use"; import classNames from 'classnames'; import { isEqual, xor } from "lodash"; import firebase from "@/shared/utils/firebase"; @@ -22,7 +23,6 @@ import { import { countTextEditorEmojiElements, parseStringToTextEditorValue } from "@/shared/ui-kit"; import { getTextFromTextEditorString } from "@/shared/components/Chat/ChatMessage/utils"; import { useRoutesContext } from "@/shared/contexts"; -import { useUpdateEffect } from "react-use"; export type TextStyles = { mentionTextCurrentUser: string;