mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 03:14:30 +03:00
interface: deleting links works
This commit is contained in:
parent
b98f38e068
commit
6c0a7ceeef
@ -80,10 +80,14 @@ class LinkWindow extends Component<LinkWindowProps, {}> {
|
|||||||
api={api}
|
api={api}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<LinkItem {...linkProps} />
|
{ typeof post !== 'string' && <LinkItem {...linkProps} /> }
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof post === 'string') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return <LinkItem key={index.toString()} {...linkProps} />;
|
return <LinkItem key={index.toString()} {...linkProps} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -49,11 +49,8 @@ export function CommentItem(props: CommentItemProps): ReactElement {
|
|||||||
const children = Array.from(revs.children);
|
const children = Array.from(revs.children);
|
||||||
let indices = [];
|
let indices = [];
|
||||||
for (let child in children) {
|
for (let child in children) {
|
||||||
console.log(child);
|
|
||||||
let node = children[child];
|
let node = children[child];
|
||||||
if (node?.post && typeof node.post === 'string') {
|
if (!node?.post || typeof node.post !== 'string') {
|
||||||
console.log(node.post);
|
|
||||||
} else {
|
|
||||||
indices.push(node.post?.index);
|
indices.push(node.post?.index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -105,6 +102,7 @@ export function CommentItem(props: CommentItemProps): ReactElement {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!post || typeof post === 'string') {
|
if (!post || typeof post === 'string') {
|
||||||
|
// TODO: if typeof post === 'string', show some deleted state
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user