interface: deleted group feed posts that get linked to work properly

This commit is contained in:
Logan Allen 2021-05-06 13:19:04 -05:00
parent 1923df064e
commit 441e20671f

View File

@ -1,4 +1,4 @@
import { Box, Col } from '@tlon/indigo-react'; import { Box, Col, Text } from '@tlon/indigo-react';
import bigInt from 'big-integer'; import bigInt from 'big-integer';
import React from 'react'; import React from 'react';
import { resourceFromPath } from '~/logic/lib/group'; import { resourceFromPath } from '~/logic/lib/group';
@ -35,15 +35,15 @@ export class PostFeed extends React.Component {
const graphResource = resourceFromPath(graphPath); const graphResource = resourceFromPath(graphPath);
const node = graph.get(index); const node = graph.get(index);
if (!node) { if (!node) {
return null; return null;
} }
const first = graph.peekLargest()?.[0]; const first = graph.peekLargest()?.[0];
const post = node?.post; const post = node?.post;
if (!node || !post) { const nodeIndex =
return null; ( parentNode &&
} typeof parentNode.post !== 'string'
const nodeIndex = parentNode ? parentNode.post.index.split('/').slice(1).map((ind) => { ) ? parentNode.post.index.split('/').slice(1).map((ind) => {
return bigInt(ind); return bigInt(ind);
}) : []; }) : [];