mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 11:24:21 +03:00
interface: fix up issues from zustand merge
This commit is contained in:
parent
2e45f4fd99
commit
bdfa1650cf
@ -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]
|
||||||
|
@ -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: ''
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
@ -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');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user