mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-11 16:09:31 +03:00
ChatInput, Author: fix "removed avatar" case
This commit is contained in:
parent
1df231f79e
commit
93a3d22816
@ -128,12 +128,12 @@ class ChatInput extends Component<ChatInputProps, ChatInputState> {
|
||||
|
||||
const avatar = (
|
||||
props.ourContact &&
|
||||
((props.ourContact.avatar !== null) && !props.hideAvatars)
|
||||
((props.ourContact?.avatar) && !props.hideAvatars)
|
||||
)
|
||||
? <BaseImage
|
||||
src={props.ourContact.avatar}
|
||||
height={16}
|
||||
width={16}
|
||||
? <BaseImage
|
||||
src={props.ourContact.avatar}
|
||||
height={16}
|
||||
width={16}
|
||||
style={{ objectFit: 'cover' }}
|
||||
display='inline-block'
|
||||
/>
|
||||
|
@ -7,6 +7,7 @@ import { Contacts } from '@urbit/api/contacts';
|
||||
import { Group } from '@urbit/api';
|
||||
|
||||
import { uxToHex, cite, useShowNickname, deSig } from '~/logic/lib/util';
|
||||
import useSettingsState, {selectCalmState} from "~/logic/state/settings";
|
||||
import OverlaySigil from './OverlaySigil';
|
||||
import { Sigil } from '~/logic/lib/sigil';
|
||||
import GlobalApi from '~/logic/api/global';
|
||||
@ -33,6 +34,7 @@ export default function Author(props: AuthorProps): ReactElement {
|
||||
}
|
||||
const color = contact?.color ? `#${uxToHex(contact?.color)}` : '#000000';
|
||||
const showNickname = useShowNickname(contact);
|
||||
const { hideAvatars } = useSettingsState(selectCalmState);
|
||||
const name = showNickname ? contact.nickname : cite(ship);
|
||||
const stamp = moment(date);
|
||||
|
||||
@ -43,7 +45,7 @@ export default function Author(props: AuthorProps): ReactElement {
|
||||
};
|
||||
|
||||
const img =
|
||||
contact && contact.avatar !== null ? (
|
||||
contact?.avatar && !hideAvatars ? (
|
||||
<BaseImage
|
||||
display='inline-block'
|
||||
src={contact.avatar}
|
||||
|
Loading…
Reference in New Issue
Block a user