interface: fix group joining and display of share profile view

This commit is contained in:
Logan Allen 2021-02-03 13:09:39 -06:00
parent 83edfd67ba
commit ea2d740d1c
4 changed files with 6 additions and 5 deletions

View File

@ -24,11 +24,11 @@ export function makeResource(ship: string, name: string) {
export function isWriter(group: Group, resource: string) {
const writers: Set<string> | undefined = _.get(
group.tags,
["graph", resource, "writers"],
group,
["tags", "graph", resource, "writers"],
undefined
);
const admins = group.tags?.role?.admin ?? new Set();
const admins = group?.tags?.role?.admin ?? new Set();
if (_.isUndefined(writers)) {
return true;
} else {

View File

@ -83,7 +83,7 @@ export const ShareProfile = (props) => {
p={1}
alignItems="center"
borderRadius={2}
backgroundColor={!props.our ? `#${uxToHex(props.our.color)}` : "#000000"}>
backgroundColor={!!props.our ? `#${uxToHex(props.our.color)}` : "#000000"}>
<Sigil
ship={window.ship}
size={16}

View File

@ -76,7 +76,7 @@ export function GraphPermissions(props: GraphPermissionsProps) {
const { api, group, association } = props;
const writers = _.get(
group.tags,
group?.tags,
["graph", association.resource, "writers"],
new Set()
);

View File

@ -87,6 +87,7 @@ export function JoinGroup(props: JoinGroupProps) {
(group in (p.associations?.graph ?? {})
|| group in (p.associations?.groups ?? {}))
});
if(props.groups?.[group]?.hidden) {
const { metadata } = associations.graph[group];
history.push(`/~landscape/home/resource/${metadata.module}${group}`);