Skip to content

Commit

Permalink
fix: maintenance issues
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurlbrjc committed Dec 3, 2024
1 parent d10e97c commit e279ed8
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 33 deletions.
8 changes: 4 additions & 4 deletions clients/firebase.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@ export function observeDerniersMessagesDuChat(
limit(nbMessages)
),
(querySnapshot: QuerySnapshot<FirebaseMessage, FirebaseMessage>) => {
const messages: Message[] = querySnapshot.docs.map((doc) =>
docSnapshotToMessage(doc, beneficiaireEtChat.id)
const messages: Message[] = querySnapshot.docs.map((docSnapshot) =>
docSnapshotToMessage(docSnapshot, beneficiaireEtChat.id)
)
if (messages.length && !messages.at(-1)!.creationDate) {
return
Expand Down Expand Up @@ -567,8 +567,8 @@ export async function getMessagesPeriode(
)
)

return querySnapshots.docs.map((doc) =>
docSnapshotToMessage(doc, beneficiaireEtChat.id)
return querySnapshots.docs.map((docSnapshot) =>
docSnapshotToMessage(docSnapshot, beneficiaireEtChat.id)
)
}

Expand Down
20 changes: 3 additions & 17 deletions components/__mocks__/ModalContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
import {
ForwardedRef,
forwardRef,
MouseEvent,
ReactNode,
useImperativeHandle,
} from 'react'
import { ForwardedRef, forwardRef, useImperativeHandle } from 'react'

import { ModalHandles } from 'components/Modal'
import { ModalContainerProps, ModalHandles } from 'components/ModalContainer'

function FakeModalContainer(
{
children,
title,
onClose,
}: {
title: string
children: ReactNode
onClose: (e: KeyboardEvent | MouseEvent) => void
},
{ children, onClose }: ModalContainerProps,
ref: ForwardedRef<ModalHandles>
) {
useImperativeHandle(ref, () => ({
Expand Down
3 changes: 1 addition & 2 deletions components/chat/LienAction.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import Link from 'next/link'
import React from 'react'

import { InfoAction, InfoOffre } from 'interfaces/message'
import { TypeOffre } from 'interfaces/offre'
import { InfoAction } from 'interfaces/message'

export default function LienAction({
infoAction,
Expand Down
2 changes: 0 additions & 2 deletions interfaces/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,4 @@ export function getPreviousItemId<T extends { id: string }>(
if (previousDay.messages.length) return previousDay.messages.at(-1)!.id // dernier item du 1er jour précédent avec des items
indexPreviousDay--
}

return
}
14 changes: 7 additions & 7 deletions services/messages.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import {
CreateFirebaseMessagePartageOffre,
deleteMessageImportant,
findAndObserveChatsDuConseiller,
findMessageImportant,
getChatDuBeneficiaire,
getChatsDuConseiller,
getIdLastMessage,
findMessageImportant,
getMessagesGroupe,
getMessagesPeriode,
observeChat,
Expand All @@ -23,7 +24,6 @@ import {
signOut as _signOut,
updateChat,
updateMessage,
getChatDuBeneficiaire,
} from 'clients/firebase.client'
import { Action } from 'interfaces/action'
import {
Expand Down Expand Up @@ -599,15 +599,15 @@ async function envoyerCommentaireAction(

await Promise.all([
notifierNouveauMessage(
session!.user.id,
session.user.id,
[idDestinataire],
session!.accessToken
session.accessToken
),
evenementMessage(
'MESSAGE_ACTION_COMMENTEE',
session!.user.structure,
session!.user.id,
session!.accessToken
session.user.structure,
session.user.id,
session.accessToken
),
])
}
Expand Down
2 changes: 1 addition & 1 deletion tests/components/ActualitesModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('ActualitesModal', () => {
level: 3,
name: 'Invitation à la journée présentiel du 31 octobre 2024',
})
)
).toBeInTheDocument()
expect(screen.getByText('Catégorie')).toBeInTheDocument()
expect(
screen.getByText('Rdv demain aux nouveaux locaux de la Fabrique')
Expand Down

0 comments on commit e279ed8

Please sign in to comment.