interface: re-render reply view properly by modifying locationUrl prop

This commit is contained in:
Logan Allen 2021-03-26 17:07:28 -05:00
parent 9fa768dfe8
commit 58087d45bd
3 changed files with 8 additions and 3 deletions

View File

@ -29,6 +29,8 @@ export function GroupFeed(props) {
const relativePath = (path) => baseUrl + path;
const association = associations.graph[graphPath];
const locationUrl = history.location.pathname;
const graphId = `${graphResource.ship.slice(1)}/${graphResource.name}`;
const graph = graphs[graphId];
@ -70,6 +72,7 @@ export function GroupFeed(props) {
render={(routeProps) => {
return (
<PostReplies
locationUrl={locationUrl}
baseUrl={baseUrl}
api={api}
history={history}

View File

@ -32,6 +32,7 @@ export function GroupHome(props) {
'resource' in metadata.config.group;
const graphPath = metadata?.config?.group?.resource;
const history = useHistory();
return (

View File

@ -15,7 +15,6 @@ export default class PostReplies extends React.PureComponent {
}
render() {
let graph = this.props.graph;
const {
baseUrl,
api,
@ -28,6 +27,8 @@ export default class PostReplies extends React.PureComponent {
const graphResource = resourceFromPath(graphPath);
const graphId = `${graphResource.ship.slice(1)}/${graphResource.name}`;
let graph = this.props.graph;
const shouldRenderFeed = !!graph;
if (!shouldRenderFeed) {
@ -39,7 +40,7 @@ export default class PostReplies extends React.PureComponent {
}
const locationUrl =
history.location.pathname.replace(`${baseUrl}/feed`, '');
this.props.locationUrl.replace(`${baseUrl}/feed`, '');
let nodeIndex = locationUrl.split('/').slice(1).map((ind) => {
return bigInt(ind);
});
@ -64,7 +65,7 @@ export default class PostReplies extends React.PureComponent {
if (!first) {
return (
<Col
key={0}
key={locationUrl}
width="100%"
height="100%"
alignItems="center" overflowY="scroll">