mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-02 07:06:41 +03:00
interface: fix group joining and display of share profile view
This commit is contained in:
parent
83edfd67ba
commit
ea2d740d1c
@ -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 {
|
||||
|
@ -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}
|
||||
|
@ -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()
|
||||
);
|
||||
|
@ -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}`);
|
||||
|
Loading…
Reference in New Issue
Block a user