Skip to content

Commit

Permalink
CW-2196 Fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pvm-code committed Nov 27, 2023
1 parent 90bacb5 commit a06c129
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/services/DiscussionMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ class DiscussionMessageService {
discussionId: string,
lastVisible: firebase.firestore.QueryDocumentSnapshot<DiscussionMessage> | null,
endDate: Date
): Promise<{ data: DiscussionMessage[], lastVisibleSnapshot: firebase.firestore.QueryDocumentSnapshot<DiscussionMessage> }> => {
): Promise<{
data: DiscussionMessage[],
lastVisibleSnapshot: firebase.firestore.QueryDocumentSnapshot<DiscussionMessage>
}> => {
const snapshot = await this.getDiscussionMessageCollection().where(
"discussionId",
"==",
Expand All @@ -51,7 +54,10 @@ class DiscussionMessageService {
.get();
const dataAfterEndDate = transformFirebaseDataList<DiscussionMessage>(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,
Expand Down
2 changes: 1 addition & 1 deletion src/shared/hooks/useCases/useDiscussionMessagesById.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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;
Expand Down

0 comments on commit a06c129

Please sign in to comment.