Skip to content

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

REFACTOR: removes overwritten properties and duplicates fn (#9686)

Joffrey JAFFEUX1dd9df9cd083
diff --git a/app/assets/javascripts/admin/components/admin-report.js b/app/assets/javascripts/admin/components/admin-report.js
index 757a90a7dbc..352b92fb939 100644
--- a/app/assets/javascripts/admin/components/admin-report.js
+++ b/app/assets/javascripts/admin/components/admin-report.js
@@ -59,8 +59,6 @@ export default Component.extend({
forcedModes: null,
showAllReportsLink: false,
filters: null,
- startDate: null,
- endDate: null,
showTrend: false,
showHeader: true,
showTitle: true,
diff --git a/app/assets/javascripts/discourse/app/components/text-field.js b/app/assets/javascripts/discourse/app/components/text-field.js
index 5809d25a86c..affad24e803 100644
--- a/app/assets/javascripts/discourse/app/components/text-field.js
+++ b/app/assets/javascripts/discourse/app/components/text-field.js
@@ -6,9 +6,6 @@ import { next, debounce, cancel } from "@ember/runloop";
const DEBOUNCE_MS = 500;
export default TextField.extend({
- _prevValue: null,
- _timer: null,
-
attributeBindings: [
"autocorrect",
"autocapitalize",
@@ -17,13 +14,22 @@ export default TextField.extend({
"dir"
],
+ init() {
+ this._super(...arguments);
+
+ this._prevValue = null;
+ this._timer = null;
+ },
+
didReceiveAttrs() {
this._super(...arguments);
+
this._prevValue = this.value;
},
didUpdateAttrs() {
this._super(...arguments);
+
if (this._prevValue !== this.value) {
if (this.onChangeImmediate) {
next(() => this.onChangeImmediate(this.value));
@@ -71,27 +77,6 @@ export default TextField.extend({
}
},
- didReceiveAttrs() {
- this._super(...arguments);
- this._prevValue = this.value;
- },
-
- didUpdateAttrs() {
- this._super(...arguments);
- if (this._prevValue !== this.value) {
- if (this.onChangeImmediate) {
- next(() => this.onChangeImmediate(this.value));
- }
- if (this.onChange) {
- debounce(this, this._debouncedChange, DEBOUNCE_MS);
- }
- }
- },
-
- _debouncedChange() {
- next(() => this.onChange(this.value));
- },
-
@discourseComputed("placeholderKey")
placeholder: {
get() {
diff --git a/app/assets/javascripts/discourse/app/controllers/composer.js b/app/assets/javascripts/discourse/app/controllers/composer.js
index 9ed71e654a3..6a0fa4e6eff 100644
--- a/app/assets/javascripts/discourse/app/controllers/composer.js
+++ b/app/assets/javascripts/discourse/app/controllers/composer.js
@@ -95,8 +95,6 @@ export default Controller.extend({
scopedCategoryId: null,
lastValidatedAt: null,
isUploading: false,
- allowUpload: false,
- uploadIcon: "upload",
topic: null,
linkLookup: null,
showPreview: true,
diff --git a/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6 b/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6
index df092d9a898..0ba26c48b46 100644
--- a/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6
+++ b/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6
@@ -24,7 +24,6 @@ export default Component.extend({
formats: null,
recurring: null,
advancedMode: false,
- isValid: true,
timezone: null,
fromSelected: null,
fromFilled: notEmpty("date"),