SidebarList: fix empty contact nick

This commit is contained in:
Liam Fitzgerald 2021-05-20 15:28:44 +10:00
parent 93335fc1ea
commit 2e4eda036b
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
2 changed files with 3 additions and 3 deletions

View File

@ -101,7 +101,7 @@ export function SidebarDmItem(props: {
}) {
const { ship, selected = false } = props;
const contact = useContact(ship);
const title = contact?.nickname ?? cite(ship) ?? ship;
const title = contact?.nickname || (cite(ship) ?? ship)
const hideAvatars = false;
const img =
contact?.avatar && !hideAvatars ? (

View File

@ -33,10 +33,10 @@ function sidebarSort(
const bAppName = bAssoc?.['app-name'];
const aUpdated = a.startsWith('~')
? (inboxUnreads?.[`/${patpToUd(a)}`]?.last)
? (inboxUnreads?.[`/${patp2dec(a)}`]?.last)
: apps[aAppName]?.lastUpdated(a) || 0;
const bUpdated = b.startsWith('~')
? (inboxUnreads?.[`/${patpToUd(b)}`]?.last || 0)
? (inboxUnreads?.[`/${patp2dec(b)}`]?.last || 0)
: apps[bAppName]?.lastUpdated(b) || 0;
return bUpdated - aUpdated || alphabetical(a, b);