client: fix some incorrect references

This commit is contained in:
noirscape 2023-01-04 22:34:48 +01:00
parent 467937a952
commit 115d436a06
5 changed files with 6 additions and 10 deletions

View file

@ -19,7 +19,7 @@ class PostMainController extends BasePostController {
let poolPostsNearby = Promise.resolve({results: []});
if (api.hasPrivilege("pools:list") && api.hasPrivilege("pools:view")) {
poolPostsNearby = PostList.getNearbyPoolPosts(ctx.parameters.id)
poolPostsNearby = PostList.getNearbyPoolPosts(ctx.parameters.id);
}
let parameters = ctx.parameters;

View file

@ -28,9 +28,6 @@ class PoolNavigatorListControl extends events.EventTarget {
poolListItemNode,
poolPostNearby,
);
// events.proxyEvent(commentControl, this, "submit");
// events.proxyEvent(commentControl, this, "score");
// events.proxyEvent(commentControl, this, "delete");
this._indexToNode[poolPostNearby.id] = poolListItemNode;
this._poolNavigatorListNode.appendChild(poolListItemNode);
}

View file

@ -19,7 +19,6 @@ class PostList extends AbstractList {
static getNearbyPoolPosts(id) {
return api.get(
uri.formatApiLink("post", id, "pools-nearby", {
query: PostList._decorateSearchQuery(searchQuery || ""),
fields: "id",
})
);

View file

@ -58,7 +58,7 @@ class PostMainView {
this._installSidebar(ctx);
this._installCommentForm();
this._installComments(ctx.post.comments);
this._installPoolNavigators(ctx.poolPostsAround);
this._installPoolNavigators(ctx.poolPostsNearby);
const showPreviousImage = () => {
if (ctx.prevPostId) {
@ -139,7 +139,7 @@ class PostMainView {
}
}
_installPoolNavigators(poolPostsAround) {
_installPoolNavigators(poolPostsNearby) {
const poolNavigatorsContainerNode = document.querySelector(
"#content-holder .pool-navigators-container"
);
@ -149,7 +149,7 @@ class PostMainView {
this.poolNavigatorsControl = new PoolNavigatorListControl(
poolNavigatorsContainerNode,
poolPostsAround,
poolPostsNearby,
);
}

View file

@ -1016,7 +1016,7 @@ def serialize_pool_posts_nearby(
"pool": pools.serialize_micro_pool(entry.pool),
"firstPost": serialize_micro_post(try_get_post_by_id(entry.first_post), None),
"lastPost": serialize_micro_post(try_get_post_by_id(entry.last_post), None),
"prevPost": serialize_micro_post(try_get_post_by_id(entry.prev_post), None),
"previousPost": serialize_micro_post(try_get_post_by_id(entry.prev_post), None),
"nextPost": serialize_micro_post(try_get_post_by_id(entry.next_post), None),
} for entry in nearby
]