mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 03:14:30 +03:00
interface: re-render reply view properly by modifying locationUrl prop
This commit is contained in:
parent
9fa768dfe8
commit
58087d45bd
@ -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}
|
||||
|
@ -32,6 +32,7 @@ export function GroupHome(props) {
|
||||
'resource' in metadata.config.group;
|
||||
|
||||
const graphPath = metadata?.config?.group?.resource;
|
||||
|
||||
const history = useHistory();
|
||||
|
||||
return (
|
||||
|
@ -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">
|
||||
|
Loading…
Reference in New Issue
Block a user