Skip to content

Commit

Permalink
restore original UI behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
rajku-dev committed Feb 10, 2025
1 parent 44edd7a commit e50a2a7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/pages/Encounters/tabs/EncounterNotesTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ export const EncounterNotesTab = ({ encounter }: EncounterTabProps) => {
useEffect(() => {
if (inView && hasNextPage) {
fetchNextPage();
messagesEndRef.current?.scrollIntoView();
}
}, [
inView,
Expand Down Expand Up @@ -637,12 +638,7 @@ export const EncounterNotesTab = ({ encounter }: EncounterTabProps) => {
</div>
) : (
messages.map((message, index) => (
<div
key={message.id}
ref={index === messages.length / 2 ? ref : null}
>
<MessageItem key={message.id} message={message} />
</div>
<MessageItem key={message.id} message={message} />
))
)}
{isFetchingNextPage ? (
Expand All @@ -651,7 +647,9 @@ export const EncounterNotesTab = ({ encounter }: EncounterTabProps) => {
<CardListSkeleton count={3} />
</div>
</div>
) : null}
) : (
<div ref={ref} />
)}
</div>
</ScrollArea>
{/* Message Input */}
Expand Down

0 comments on commit e50a2a7

Please sign in to comment.