mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 14:42:55 +08:00
allow for incomplete fixture
This commit is contained in:
parent
f1b1b0da14
commit
d1bb71f99d
|
@ -184,12 +184,15 @@ const User = RestModel.extend({
|
||||||
|
|
||||||
['muted','watched','tracked','watched_first_post'].forEach(s => {
|
['muted','watched','tracked','watched_first_post'].forEach(s => {
|
||||||
let prop = s === "watched_first_post" ? "watchedFirstPostCategories" : s + "Categories";
|
let prop = s === "watched_first_post" ? "watchedFirstPostCategories" : s + "Categories";
|
||||||
let cats = this.get(prop).map(c => c.get('id'));
|
let cats = this.get(prop);
|
||||||
updatedState[s + '_category_ids'] = cats;
|
if (cats) {
|
||||||
|
let cat_ids = cats.map(c => c.get('id'));
|
||||||
|
updatedState[s + '_category_ids'] = cat_ids;
|
||||||
|
|
||||||
// HACK: denote lack of categories
|
// HACK: denote lack of categories
|
||||||
if (cats.length === 0) { cats = [-1]; }
|
if (cats.length === 0) { cat_ids = [-1]; }
|
||||||
data[s + '_category_ids'] = cats;
|
data[s + '_category_ids'] = cat_ids;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!Discourse.SiteSettings.edit_history_visible_to_public) {
|
if (!Discourse.SiteSettings.edit_history_visible_to_public) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user