SidebarListHeader: look in %groups not %contacts assocs

Fixes urbit/landscape#405
This commit is contained in:
Liam Fitzgerald 2021-02-16 11:14:50 +10:00
parent ba57ad2222
commit a9d2381d0e
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB

View File

@ -42,9 +42,9 @@ export function SidebarListHeader(props: {
);
const groupPath = getGroupFromWorkspace(props.workspace);
const role = props.groups?.[groupPath] ? roleForShip(props.groups[groupPath], window.ship) : undefined;
const role = groupPath && props.groups?.[groupPath] ? roleForShip(props.groups[groupPath], window.ship) : undefined;
const memberMetadata =
groupPath ? props.associations.contacts?.[groupPath].metadata.vip === 'member-metadata' : false;
groupPath ? props.associations.groups?.[groupPath].metadata.vip === 'member-metadata' : false;
const isAdmin = memberMetadata || (role === "admin") || (props.workspace?.type === 'home') || (props.workspace?.type === "messages");