mirror of
https://github.com/urbit/shrub.git
synced 2024-12-23 19:05:48 +03:00
Post: fix various crashes
This commit is contained in:
parent
b506eb44eb
commit
45e11204d3
@ -15,7 +15,7 @@ export function GroupFeedHeader(props) {
|
||||
historyLocation === `${baseUrl}/feed`;
|
||||
|
||||
const locationUrl =
|
||||
history.location.pathname.replace(`${baseUrl}`, '').replace(/^\/[a-z]*/, '');
|
||||
history.location.pathname.replace(`${baseUrl}`, '').replace(/^\/[a-z|\/]*/, '');
|
||||
let nodeIndex = locationUrl.split('/').slice(1).map((ind) => {
|
||||
return bigInt(ind);
|
||||
});
|
||||
|
@ -34,11 +34,11 @@ export class PostFeed extends React.Component {
|
||||
if (!node || !post) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let nodeIndex = parentNode ? parentNode.post.index.split('/').slice(1).map((ind) => {
|
||||
return bigInt(ind);
|
||||
}) : [];
|
||||
|
||||
if (parentNode && index.eq(first ?? bigInt.zero)) {
|
||||
let nodeIndex = parentNode.post.index.split('/').slice(1).map((ind) => {
|
||||
return bigInt(ind);
|
||||
});
|
||||
|
||||
return (
|
||||
<React.Fragment key={index.toString()}>
|
||||
@ -88,7 +88,7 @@ export class PostFeed extends React.Component {
|
||||
graphResource={graphResource}
|
||||
association={association}
|
||||
api={api}
|
||||
index={[index]}
|
||||
index={[...nodeIndex, index]}
|
||||
baseUrl={baseUrl}
|
||||
history={history}
|
||||
parentPost={parentNode?.post}
|
||||
|
Loading…
Reference in New Issue
Block a user