Skip to content

Commit

Permalink
Merge pull request #17745 from wireapp/dev
Browse files Browse the repository at this point in the history
chore: merge dev to new-navigation
  • Loading branch information
PatrykBuniX authored Jul 12, 2024
2 parents 4ccb808 + 7e05864 commit 8a7df3b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/script/components/Conversation/Conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
*/

import {UIEvent, useCallback, useState} from 'react';
import {UIEvent, useCallback, useEffect, useState} from 'react';

import cx from 'classnames';
import {container} from 'tsyringe';
Expand Down Expand Up @@ -124,6 +124,12 @@ export const Conversation = ({

const {addReadReceiptToBatch} = useReadReceiptSender(repositories.message);

useEffect(() => {
// When the component is mounted we want to make sure its conversation entity's last message is marked as visible
// not to display the jump to last message button initially
activeConversation?.isLastMessageVisible(true);
}, [activeConversation]);

const uploadImages = useCallback(
(images: File[]) => {
if (!activeConversation || isHittingUploadLimit(images, repositories.asset)) {
Expand Down
3 changes: 3 additions & 0 deletions src/script/components/MessagesList/Message/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ export const Message = (props: MessageParams & {scrollTo?: ScrollToElement}) =>
}
}, [isFocused]);

// When component is unmounted, it's not visible anymore
useEffect(() => onVisibilityLost, [onVisibilityLost]);

// set message elements focus for non content type mesages
// some non content type message has interactive element like invite people for member message
useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export function EmojiPickerPlugin({openStateRef}: Props) {
const {bottom, left} = getPosition();

return ReactDOM.createPortal(
<div className="typeahead-popover emoji-menu">
<div data-outside-click-ignore className="typeahead-popover emoji-menu">
<div className="conversation-input-bar-emoji-list" style={{bottom, left}}>
{options.map((option: EmojiOption, index) => (
<EmojiItem
Expand Down

0 comments on commit 8a7df3b

Please sign in to comment.