mirror of
https://github.com/urbit/shrub.git
synced 2024-12-20 01:01:37 +03:00
Merge pull request #4412 from urbit/la/fix-385
interface: redirect to base url when unsubscribing, removing, or arch…
This commit is contained in:
commit
7176577d13
@ -43,13 +43,16 @@ export function ChannelPopoverRoutes(props: ChannelPopoverRoutesProps) {
|
|||||||
const handleUnsubscribe = async () => {
|
const handleUnsubscribe = async () => {
|
||||||
const [,,ship,name] = association.resource.split('/');
|
const [,,ship,name] = association.resource.split('/');
|
||||||
await api.graph.leaveGraph(ship, name);
|
await api.graph.leaveGraph(ship, name);
|
||||||
|
history.push(props.rootUrl);
|
||||||
};
|
};
|
||||||
const handleRemove = async () => {
|
const handleRemove = async () => {
|
||||||
await api.metadata.remove('graph', association.resource, association.group);
|
await api.metadata.remove('graph', association.resource, association.group);
|
||||||
|
history.push(props.rootUrl);
|
||||||
};
|
};
|
||||||
const handleArchive = async () => {
|
const handleArchive = async () => {
|
||||||
const [,,,name] = association.resource.split('/');
|
const [,,,name] = association.resource.split('/');
|
||||||
await api.graph.deleteGraph(name);
|
await api.graph.deleteGraph(name);
|
||||||
|
history.push(props.baseUrl);
|
||||||
};
|
};
|
||||||
|
|
||||||
const canAdmin = isChannelAdmin(group, association.resource);
|
const canAdmin = isChannelAdmin(group, association.resource);
|
||||||
|
@ -33,7 +33,6 @@ export function Resource(props: ResourceProps) {
|
|||||||
const rid = association.resource;
|
const rid = association.resource;
|
||||||
const selectedGroup = association.group;
|
const selectedGroup = association.group;
|
||||||
const relativePath = (p: string) =>
|
const relativePath = (p: string) =>
|
||||||
|
|
||||||
`${props.baseUrl}/resource/${app}${rid}${p}`;
|
`${props.baseUrl}/resource/${app}${rid}${p}`;
|
||||||
const skelProps = { api, association, groups, contacts };
|
const skelProps = { api, association, groups, contacts };
|
||||||
let title = props.association.metadata.title;
|
let title = props.association.metadata.title;
|
||||||
@ -71,6 +70,7 @@ export function Resource(props: ResourceProps) {
|
|||||||
contacts={props.contacts}
|
contacts={props.contacts}
|
||||||
api={props.api}
|
api={props.api}
|
||||||
baseUrl={relativePath("")}
|
baseUrl={relativePath("")}
|
||||||
|
rootUrl={props.baseUrl}
|
||||||
notificationsGraphConfig={notificationsGraphConfig}
|
notificationsGraphConfig={notificationsGraphConfig}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user