Avoid processing popular posts twice
Problem: Messages are being fetched with `post.get()`, which runs the `transform()` function to decorate them with Markdown/etc, but then they're being passed through `transform()` a second time at the end of the function. This is inefficient and applies side-effects (like adding channels to the post) twice. Solution: Remove the final `transform()` so that these posts are only decorated once. Fixes: https://github.com/fraction/oasis/issues/358
This commit is contained in:
parent
4883efbc2c
commit
5b2ae2a219
|
@ -1065,7 +1065,7 @@ module.exports = ({ cooler, isPublic }) => {
|
|||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(transform(ssb, collectedMessages, myFeedId));
|
||||
resolve(collectedMessages);
|
||||
}
|
||||
})
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue