mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 11:02:46 +08:00
FIX: Async load category for composer (#27004)
Categories are loaded in the composer via the category chooser, but that only loads a subset of the fields. With these changes, the category will be loaded async to make sure that the template is updated.
This commit is contained in:
parent
c3923574b9
commit
2b5e0bca53
|
@ -248,7 +248,13 @@ export default class Composer extends RestModel {
|
|||
this._categoryId = categoryId;
|
||||
|
||||
if (oldCategoryId !== categoryId) {
|
||||
this.applyTopicTemplate(oldCategoryId, categoryId);
|
||||
if (this.site.lazy_load_categories) {
|
||||
Category.asyncFindById(categoryId).then(() => {
|
||||
this.applyTopicTemplate(oldCategoryId, categoryId);
|
||||
});
|
||||
} else {
|
||||
this.applyTopicTemplate(oldCategoryId, categoryId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user