mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-11 04:48:00 +03:00
interface: finish delete graph integration
This commit is contained in:
parent
f426da1753
commit
6503bb9164
@ -86,8 +86,9 @@ const removeGraph = (json, state) => {
|
||||
if (!('graphs' in state)) {
|
||||
state.graphs = {};
|
||||
}
|
||||
let resource = data.resource.ship + '/' + data.resource.name;
|
||||
let resource = data.ship + '/' + data.name;
|
||||
delete state.graphs[resource];
|
||||
state.graphKeys.delete(resource);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -99,7 +99,10 @@ export class LinksApp extends Component {
|
||||
|
||||
const autoJoin = () => {
|
||||
try {
|
||||
// TODO: graph join
|
||||
api.graph.joinGraph(
|
||||
`~${props.match.params.ship}`,
|
||||
props.match.params.name
|
||||
);
|
||||
props.history.push(`/~link/${resource}`);
|
||||
} catch(err) {
|
||||
setTimeout(autoJoin, 2000);
|
||||
@ -121,6 +124,7 @@ export class LinksApp extends Component {
|
||||
const contactDetails = contacts[resource['group-path']] || {};
|
||||
const group = groups[resource['group-path']] || new Set([]);
|
||||
const amOwner = amOwnerOfGroup(resource['group-path']);
|
||||
const hasGraph = !!graphs[resourcePath];
|
||||
|
||||
return (
|
||||
<Skeleton
|
||||
@ -138,6 +142,7 @@ export class LinksApp extends Component {
|
||||
contacts={contacts}
|
||||
contactDetails={contactDetails}
|
||||
graphResource={graphKeys.has(resourcePath)}
|
||||
hasGraph={!!hasGraph}
|
||||
group={group}
|
||||
amOwner={amOwner}
|
||||
resourcePath={resourcePath}
|
||||
|
@ -26,8 +26,6 @@ export class SettingsScreen extends Component {
|
||||
componentDidUpdate() {
|
||||
const { props, state } = this;
|
||||
|
||||
console.log(props.resource);
|
||||
|
||||
if (Boolean(state.isLoading) && !props.resource) {
|
||||
this.setState({
|
||||
isLoading: false
|
||||
@ -69,7 +67,6 @@ export class SettingsScreen extends Component {
|
||||
type: 'Deleting'
|
||||
});
|
||||
|
||||
console.log(props.match.params.name);
|
||||
props.api.graph.deleteGraph(props.match.params.name);
|
||||
}
|
||||
|
||||
@ -117,12 +114,16 @@ export class SettingsScreen extends Component {
|
||||
|
||||
render() {
|
||||
const { props, state } = this;
|
||||
|
||||
const title = props.resource.metadata.title || props.resourcePath;
|
||||
console.log(props);
|
||||
|
||||
if (!props.graphResource || !props.resource.metadata.color) {
|
||||
if (
|
||||
(!props.hasGraph || !props.resource.metadata.color)
|
||||
&& props.graphResource
|
||||
) {
|
||||
return <LoadingScreen />;
|
||||
} else if (!props.graphResource) {
|
||||
props.history.push('/~link');
|
||||
return <div></div>;
|
||||
}
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user