From ab7547eb7a477c92c84477a5055d796e755738fb Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Thu, 24 Oct 2024 01:38:55 +0200 Subject: [PATCH] DEV: Clean up d-toggle-switch (#29385) move the template to the bottom, inline `checked`, remove unnecessary `template-lint-disable` --- .../app/components/d-toggle-switch.gjs | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/d-toggle-switch.gjs b/app/assets/javascripts/discourse/app/components/d-toggle-switch.gjs index 261fdad9b86..542df895981 100644 --- a/app/assets/javascripts/discourse/app/components/d-toggle-switch.gjs +++ b/app/assets/javascripts/discourse/app/components/d-toggle-switch.gjs @@ -3,18 +3,23 @@ import icon from "discourse-common/helpers/d-icon"; import I18n from "discourse-i18n"; export default class DToggleSwitch extends Component { + get computedLabel() { + if (this.args.label) { + return I18n.t(this.args.label); + } + return this.args.translatedLabel; + } + - - get computedLabel() { - if (this.args.label) { - return I18n.t(this.args.label); - } - return this.args.translatedLabel; - } - - get checked() { - return this.args.state ? "true" : "false"; - } }