mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 16:02:46 +08:00
FIX: Wait for async Topic.apply_transformations
during loadMore
(#26143)
`apply_transformations` is an async function, and plugins/themes using it expect their transformations to be applied before the loadMore logic continues. This should resolve issues with unencrypted topics when scrolling down topic lists in discourse-encrypt.
This commit is contained in:
parent
0d64c886da
commit
a24c16c911
|
@ -185,13 +185,13 @@ export default class TopicList extends RestModel {
|
|||
|
||||
this.set("loadingMore", true);
|
||||
|
||||
return ajax({ url: moreUrl }).then((result) => {
|
||||
return ajax({ url: moreUrl }).then(async (result) => {
|
||||
let topicsAdded = 0;
|
||||
|
||||
if (result) {
|
||||
// the new topics loaded from the server
|
||||
const newTopics = TopicList.topicsFrom(this.store, result);
|
||||
Topic.applyTransformations(newTopics);
|
||||
await Topic.applyTransformations(newTopics);
|
||||
|
||||
this.forEachNew(newTopics, (t) => {
|
||||
t.set("highlight", topicsAdded++ === 0);
|
||||
|
|
Loading…
Reference in New Issue
Block a user