diff --git a/stylesheets/_session.scss b/stylesheets/_session.scss index fb8ef5f3b..96430acba 100644 --- a/stylesheets/_session.scss +++ b/stylesheets/_session.scss @@ -344,6 +344,6 @@ input { white-space: pre-wrap; svg { - margin-right: var(--margins-xs); + margin-inline-end: var(--margins-xs); } } diff --git a/ts/components/basic/SessionToast.tsx b/ts/components/basic/SessionToast.tsx index d90475c7f..4435a01a3 100644 --- a/ts/components/basic/SessionToast.tsx +++ b/ts/components/basic/SessionToast.tsx @@ -41,7 +41,6 @@ const IconDiv = styled.div` function DescriptionPubkeysReplaced({ description }: { description: string }) { - // const replacedWithNames = useReplacePkInTextWithNames(description); return ( diff --git a/ts/state/selectors/messages.ts b/ts/state/selectors/messages.ts index ed22b1875..92d1221f4 100644 --- a/ts/state/selectors/messages.ts +++ b/ts/state/selectors/messages.ts @@ -1,6 +1,5 @@ import { useSelector } from 'react-redux'; import { MessageModelType } from '../../models/messageType'; -import { UserUtils } from '../../session/utils'; import { MessageModelPropsWithConvoProps, PropsForAttachment, @@ -12,6 +11,7 @@ import { getIsMessageSelected, getMessagePropsByMessageId } from './conversation import { useSelectedIsPrivate } from './selectedConversation'; import { LastMessageStatusType } from '../ducks/types'; import { PubKey } from '../../session/types'; +import { useIsMe } from '../../hooks/useParamSelector'; function useMessagePropsByMessageId(messageId: string | undefined) { return useSelector((state: StateType) => getMessagePropsByMessageId(state, messageId)); @@ -32,16 +32,16 @@ const useSenderConvoProps = ( export const useAuthorProfileName = (messageId: string): string | null => { const msg = useMessagePropsByMessageId(messageId); const senderProps = useSenderConvoProps(msg); + const senderIsUs = useIsMe(msg?.propsForMessage?.sender); if (!msg || !senderProps) { return null; } - const { sender } = msg.propsForMessage; - - const senderIsUs = sender === UserUtils.getOurPubKeyStrFromCache(); const authorProfileName = senderIsUs ? window.i18n('you') - : senderProps.nickname || senderProps.displayNameInProfile || PubKey.shorten(sender); + : senderProps.nickname || + senderProps.displayNameInProfile || + PubKey.shorten(msg.propsForMessage.sender); return authorProfileName || window.i18n('unknown'); };