Merge pull request #4412 from urbit/la/fix-385

interface: redirect to base url when unsubscribing, removing, or arch…
This commit is contained in:
L 2021-02-11 13:52:46 -06:00 committed by GitHub
commit 7176577d13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -43,13 +43,16 @@ export function ChannelPopoverRoutes(props: ChannelPopoverRoutesProps) {
const handleUnsubscribe = async () => {
const [,,ship,name] = association.resource.split('/');
await api.graph.leaveGraph(ship, name);
history.push(props.rootUrl);
};
const handleRemove = async () => {
await api.metadata.remove('graph', association.resource, association.group);
history.push(props.rootUrl);
};
const handleArchive = async () => {
const [,,,name] = association.resource.split('/');
await api.graph.deleteGraph(name);
history.push(props.baseUrl);
};
const canAdmin = isChannelAdmin(group, association.resource);

View File

@ -33,7 +33,6 @@ export function Resource(props: ResourceProps) {
const rid = association.resource;
const selectedGroup = association.group;
const relativePath = (p: string) =>
`${props.baseUrl}/resource/${app}${rid}${p}`;
const skelProps = { api, association, groups, contacts };
let title = props.association.metadata.title;
@ -71,6 +70,7 @@ export function Resource(props: ResourceProps) {
contacts={props.contacts}
api={props.api}
baseUrl={relativePath("")}
rootUrl={props.baseUrl}
notificationsGraphConfig={notificationsGraphConfig}
/>
);