interface: fix up issues from zustand merge

This commit is contained in:
Logan Allen 2021-03-22 15:11:28 -05:00
parent 2e45f4fd99
commit bdfa1650cf
4 changed files with 7 additions and 4 deletions

View File

@ -73,6 +73,7 @@
creator our.bowl
config [%graph module.action]
preview %.n
hidden %.n
==
=/ met-action=action:met
[%add group graph+rid.action metadatum]

View File

@ -20,8 +20,9 @@ export default class MetadataApi extends BaseApi<StoreState> {
color,
'date-created': dateCreated,
creator,
'module': moduleName,
config: { graph: moduleName },
picture: '',
hidden: false,
preview: false,
vip: ''
}

View File

@ -55,7 +55,7 @@ export function SidebarList(props: {
const assoc = associations[a];
if (workspace?.type === 'messages') {
return (
!(assoc.group in props.associations.groups) &&
!(assoc.group in associationState.groups) &&
'graph' in assoc.metadata.config &&
assoc.metadata.config.graph === 'chat'
);
@ -64,7 +64,6 @@ export function SidebarList(props: {
assoc.group === group &&
!assoc.metadata.hidden
) : (
!(assoc.group in props.associations.groups) &&
'graph' in assoc.metadata.config &&
assoc.metadata.config.graph !== 'chat' &&
!assoc.metadata.hidden

View File

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