Minor Discourse Fixes

This commit is contained in:
Robin Ward 2016-11-30 13:45:25 -05:00
parent 4f8c6b2d83
commit 142d35a0a5
3 changed files with 4 additions and 8 deletions

View File

@ -27,8 +27,6 @@ export default Ember.Component.extend(bufferedRender({
}.property('disableActions'),
buildBuffer(buffer) {
const self = this;
const renderIcon = function(name, key, actionable) {
const title = escapeExpression(I18n.t(`topic_statuses.${key}.help`)),
startTag = actionable ? "a href" : "span",
@ -39,8 +37,8 @@ export default Ember.Component.extend(bufferedRender({
buffer.push(`<${startTag} title='${title}' class='topic-status'>${icon}</${endTag}>`);
};
const renderIconIf = function(conditionProp, name, key, actionable) {
if (!self.get(conditionProp)) { return; }
const renderIconIf = (conditionProp, name, key, actionable) => {
if (!this.get(conditionProp)) { return; }
renderIcon(name, key, actionable);
};

View File

@ -12,7 +12,7 @@ export default DiscoveryController.extend({
return Discourse.User.currentProp('staff');
},
@computed("model.categories.@each.featuredTopics.length")
@computed("model.categories.[].featuredTopics.length")
latestTopicOnly() {
return this.get("model.categories").find(c => c.get("featuredTopics.length") > 1) === undefined;
},

View File

@ -157,9 +157,7 @@ export default Ember.Controller.extend(CanCheckEmails, {
// Cook the bio for preview
model.set('name', this.get('newNameInput'));
var options = {};
return model.save(options).then(() => {
return model.save().then(() => {
if (Discourse.User.currentProp('id') === model.get('id')) {
Discourse.User.currentProp('name', model.get('name'));
}