messages: fixing mono-logic

fixes urbit/landscape#623
This commit is contained in:
James Acklin 2021-05-27 16:28:39 -04:00
parent 9ba4b0c1cf
commit 16311deee3
2 changed files with 4 additions and 4 deletions

View File

@ -25,8 +25,8 @@ const participantNames = (str: string, contacts, hideNicknames) => {
if (_.includes(str, ',') && _.startsWith(str, '~')) { if (_.includes(str, ',') && _.startsWith(str, '~')) {
const names = _.split(str, ', '); const names = _.split(str, ', ');
return names.map((name, idx) => { return names.map((name, idx) => {
if (urbitOb.isValidPatp(name) && !hideNicknames) { if (urbitOb.isValidPatp(name)) {
if (contacts[name]?.nickname) if (contacts[name]?.nickname && !hideNicknames)
return ( return (
<Text key={name} fontSize={2} fontWeight='600'> <Text key={name} fontSize={2} fontWeight='600'>
{contacts[name]?.nickname} {contacts[name]?.nickname}

View File

@ -104,8 +104,8 @@ export function SidebarItem(props: {
if (_.includes(str, ',') && _.startsWith(str, '~')) { if (_.includes(str, ',') && _.startsWith(str, '~')) {
const names = _.split(str, ', '); const names = _.split(str, ', ');
return names.map((name, idx) => { return names.map((name, idx) => {
if (urbitOb.isValidPatp(name) && !hideNicknames) { if (urbitOb.isValidPatp(name)) {
if (contacts[name]?.nickname) if (contacts[name]?.nickname && !hideNicknames)
return ( return (
<Text key={name} color={color}> <Text key={name} color={color}>
{contacts[name]?.nickname} {contacts[name]?.nickname}