mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 16:51:42 +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}
|
||||
/>
|
||||
</Col>
|
||||
<LinkItem {...linkProps} />
|
||||
{ typeof post !== 'string' && <LinkItem {...linkProps} /> }
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
if (typeof post === 'string') {
|
||||
return null;
|
||||
}
|
||||
return <LinkItem key={index.toString()} {...linkProps} />;
|
||||
};
|
||||
|
||||
@ -136,4 +140,4 @@ class LinkWindow extends Component<LinkWindowProps, {}> {
|
||||
}
|
||||
}
|
||||
|
||||
export default LinkWindow;
|
||||
export default LinkWindow;
|
||||
|
@ -49,11 +49,8 @@ export function CommentItem(props: CommentItemProps): ReactElement {
|
||||
const children = Array.from(revs.children);
|
||||
let indices = [];
|
||||
for (let child in children) {
|
||||
console.log(child);
|
||||
let node = children[child];
|
||||
if (node?.post && typeof node.post === 'string') {
|
||||
console.log(node.post);
|
||||
} else {
|
||||
if (!node?.post || typeof node.post !== 'string') {
|
||||
indices.push(node.post?.index);
|
||||
}
|
||||
}
|
||||
@ -105,6 +102,7 @@ export function CommentItem(props: CommentItemProps): ReactElement {
|
||||
);
|
||||
|
||||
if (!post || typeof post === 'string') {
|
||||
// TODO: if typeof post === 'string', show some deleted state
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user