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 creator our.bowl
config [%graph module.action] config [%graph module.action]
preview %.n preview %.n
hidden %.n
== ==
=/ met-action=action:met =/ met-action=action:met
[%add group graph+rid.action metadatum] [%add group graph+rid.action metadatum]

View File

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

View File

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

View File

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