FIX: Client not setting TopicTimer#based_on_last_post.

https://meta.discourse.org/t/incorrect-message-key-in-temporarily-closed-topic/87773
This commit is contained in:
Guo Xiang Tan 2018-05-18 16:30:59 +08:00
parent 3287f47f07
commit 2fecb4b46e
4 changed files with 11 additions and 5 deletions

View File

@ -46,5 +46,12 @@ export default Ember.Component.extend({
}
this.set("topicTimer.updateTime", time);
}
},
@observes("selection")
_updateBasedOnLastPost() {
if (!this.get('autoClose')) {
this.set('topicTimer.based_on_last_post', false);
}
},
});

View File

@ -18,7 +18,6 @@ export default Ember.Component.extend(bufferedRender({
if (!this.get('executeAt')) return;
let statusUpdateAt = moment(this.get('executeAt'));
if (statusUpdateAt < new Date()) return;
let duration = moment.duration(statusUpdateAt - moment());
let minutesLeft = duration.asMinutes();

View File

@ -9,7 +9,7 @@
input=topicTimer.updateTime
statusType=selection
includeWeekend=true
basedOnLastPost=false}}
basedOnLastPost=topicTimer.based_on_last_post}}
{{else if publishToCategory}}
<div class="control-group">
<label>{{i18n 'topic.topic_status_update.publish_to'}}</label>
@ -23,7 +23,7 @@
statusType=selection
includeWeekend=true
categoryId=topicTimer.category_id
basedOnLastPost=false}}
basedOnLastPost=topicTimer.based_on_last_post}}
{{else if autoClose}}
{{future-date-input
input=topicTimer.updateTime

View File

@ -155,7 +155,7 @@ export default ComboBoxComponent.extend(DatetimeMixin, {
},
mutateValue(value) {
if (this.get("isCustom") || this.get("isBasedOnLastPost")) {
if (value === 'pick_date_and_time' || this.get("isBasedOnLastPost")) {
this.set("value", value);
} else {
let input = null;