FIX: wrong links to subcategories in top categories section of user summary
This commit is contained in:
parent
c81bad3232
commit
864e279aaf
|
@ -19,6 +19,7 @@ import { emojiUnescape } from "discourse/lib/text";
|
|||
import PreloadStore from "preload-store";
|
||||
import { defaultHomepage } from "discourse/lib/utilities";
|
||||
import { userPath } from "discourse/lib/url";
|
||||
import Category from "discourse/models/category";
|
||||
|
||||
export const SECOND_FACTOR_METHODS = { TOTP: 1, BACKUP_CODE: 2 };
|
||||
|
||||
|
@ -665,6 +666,14 @@ const User = RestModel.extend({
|
|||
});
|
||||
}
|
||||
|
||||
if (summary.top_categories) {
|
||||
summary.top_categories.forEach(c => {
|
||||
if (c.parent_category_id) {
|
||||
c.parentCategory = Category.findById(c.parent_category_id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return summary;
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue