mirror of
https://github.com/urbit/shrub.git
synced 2024-12-11 11:02:25 +03:00
ChatInput, Author: fix "removed avatar" case
This commit is contained in:
parent
1df231f79e
commit
93a3d22816
@ -128,7 +128,7 @@ 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}
|
||||
|
@ -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