mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 01:52:42 +03:00
UnjoinedResource: fix crash
This commit is contained in:
parent
9c5b82237e
commit
d82e886e2a
@ -24,9 +24,9 @@ function isJoined(path: string) {
|
||||
return function (
|
||||
props: Pick<UnjoinedResourceProps, 'graphKeys'>
|
||||
) {
|
||||
const graphKeys = useGraphState(state => state.graphKeys);
|
||||
|
||||
const graphKey = path.substr(7);
|
||||
return graphKeys.has(graphKey);
|
||||
return props.graphKeys.has(graphKey);
|
||||
};
|
||||
}
|
||||
|
||||
@ -35,11 +35,12 @@ export function UnjoinedResource(props: UnjoinedResourceProps) {
|
||||
const history = useHistory();
|
||||
const rid = props.association.resource;
|
||||
const appName = props.association['app-name'];
|
||||
const { title, description, module } = props.association.metadata;
|
||||
const waiter = useWaitForProps(props);
|
||||
const app = useMemo(() => module || appName, [props.association]);
|
||||
const { title, description, module: mod } = props.association.metadata;
|
||||
const graphKeys = useGraphState(state => state.graphKeys);
|
||||
|
||||
const waiter = useWaitForProps({...props, graphKeys });
|
||||
const app = useMemo(() => mod || appName, [props.association]);
|
||||
|
||||
const onJoin = async () => {
|
||||
const [, , ship, name] = rid.split('/');
|
||||
await api.graph.joinGraph(ship, name);
|
||||
|
Loading…
Reference in New Issue
Block a user