interface: deleting links works

This commit is contained in:
Logan Allen 2021-04-22 15:26:31 -05:00
parent b98f38e068
commit 6c0a7ceeef
2 changed files with 8 additions and 6 deletions

View File

@ -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;

View File

@ -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;
}