mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 20:18:23 -05:00
UX: clear topic timer text when manually closing/opening (#6123)
* UX: clear topic timer text when manually closing/opening * added test for clearing topic timer status text
This commit is contained in:
@@ -8,6 +8,7 @@ export default Ember.Component.extend(
|
||||
_delayedRerender: null,
|
||||
|
||||
rerenderTriggers: [
|
||||
"topicClosed",
|
||||
"statusType",
|
||||
"executeAt",
|
||||
"basedOnLastPost",
|
||||
@@ -18,6 +19,10 @@ export default Ember.Component.extend(
|
||||
buildBuffer(buffer) {
|
||||
if (!this.get("executeAt")) return;
|
||||
|
||||
const topicStatus = this.get("topicClosed") ? "close" : "open";
|
||||
const topicStatusKnown = this.get("topicClosed") !== undefined;
|
||||
if (topicStatusKnown && topicStatus === this.get("statusType")) return;
|
||||
|
||||
let statusUpdateAt = moment(this.get("executeAt"));
|
||||
|
||||
let duration = moment.duration(statusUpdateAt - moment());
|
||||
|
||||
@@ -223,12 +223,14 @@
|
||||
|
||||
{{#if model.private_topic_timer.execute_at}}
|
||||
{{topic-timer-info
|
||||
topicClosed=model.closed
|
||||
statusType=model.private_topic_timer.status_type
|
||||
executeAt=model.private_topic_timer.execute_at
|
||||
duration=model.private_topic_timer.duration}}
|
||||
{{/if}}
|
||||
|
||||
{{topic-timer-info
|
||||
topicClosed=model.closed
|
||||
statusType=model.topic_timer.status_type
|
||||
executeAt=model.topic_timer.execute_at
|
||||
basedOnLastPost=model.topic_timer.based_on_last_post
|
||||
|
||||
Reference in New Issue
Block a user