FIX: remove topic timer info on completion

This commit is contained in:
Arpit Jalan 2019-06-13 16:17:37 +05:30
parent fbbce235ce
commit efc05e7224

View File

@ -23,12 +23,12 @@ export default Ember.Component.extend(
const topicStatusKnown = this.topicClosed !== undefined; const topicStatusKnown = this.topicClosed !== undefined;
if (topicStatusKnown && topicStatus === this.statusType) return; if (topicStatusKnown && topicStatus === this.statusType) return;
let statusUpdateAt = moment(this.executeAt); const statusUpdateAt = moment(this.executeAt);
const duration = moment.duration(statusUpdateAt - moment());
const minutesLeft = duration.asMinutes();
let duration = moment.duration(statusUpdateAt - moment()); if (minutesLeft > 0) {
let minutesLeft = duration.asMinutes();
let rerenderDelay = 1000; let rerenderDelay = 1000;
if (minutesLeft > 2160) { if (minutesLeft > 2160) {
rerenderDelay = 12 * 60 * 60000; rerenderDelay = 12 * 60 * 60000;
} else if (minutesLeft > 1410) { } else if (minutesLeft > 1410) {
@ -38,7 +38,6 @@ export default Ember.Component.extend(
} else if (minutesLeft > 2) { } else if (minutesLeft > 2) {
rerenderDelay = 60000; rerenderDelay = 60000;
} }
let autoCloseHours = this.duration || 0; let autoCloseHours = this.duration || 0;
buffer.push(`<h3>${iconHTML("far-clock")} `); buffer.push(`<h3>${iconHTML("far-clock")} `);
@ -49,7 +48,6 @@ export default Ember.Component.extend(
}; };
const categoryId = this.categoryId; const categoryId = this.categoryId;
if (categoryId) { if (categoryId) {
const category = Category.findById(categoryId); const category = Category.findById(categoryId);
@ -78,6 +76,7 @@ export default Ember.Component.extend(
rerenderDelay rerenderDelay
); );
} }
}
}, },
willDestroyElement() { willDestroyElement() {