Skip to content

A platform for community discussion. Free, open, simple.

UX: Display error message if no time frame selected in topic status update

Vinoth Kannan5ba2ef42743b
diff --git a/app/assets/javascripts/discourse/controllers/edit-topic-timer.js.es6 b/app/assets/javascripts/discourse/controllers/edit-topic-timer.js.es6
index 07d6cb83fc3..b710c5feb5d 100644
--- a/app/assets/javascripts/discourse/controllers/edit-topic-timer.js.es6
+++ b/app/assets/javascripts/discourse/controllers/edit-topic-timer.js.es6
@@ -103,6 +103,14 @@ export default Ember.Controller.extend(ModalFunctionality, {
actions: {
saveTimer() {
+ if (!this.get("topicTimer.updateTime")) {
+ this.flash(
+ I18n.t("topic.topic_status_update.time_frame_required"),
+ "alert-error"
+ );
+ return;
+ }
+
this._setTimer(
this.get("topicTimer.updateTime"),
this.get("topicTimer.status_type")
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index e2dfc29843d..5ae7ddc8626 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -1809,6 +1809,7 @@ en:
when: "When:"
public_timer_types: Topic Timers
private_timer_types: User Topic Timers
+ time_frame_required: Please select a time frame
auto_update_input:
none: "Select a timeframe"
later_today: "Later today"