mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 12:34:34 +08:00
DEV: global s/this.get\("(\w+)"\)/this.$1 (#7592)
This commit is contained in:
@ -21,16 +21,16 @@ export default Ember.Component.extend({
|
||||
|
||||
@observes("word")
|
||||
removeMessage() {
|
||||
if (this.get("showMessage") && !Ember.isEmpty(this.get("word"))) {
|
||||
if (this.showMessage && !Ember.isEmpty(this.word)) {
|
||||
this.set("showMessage", false);
|
||||
}
|
||||
},
|
||||
|
||||
@computed("word")
|
||||
isUniqueWord(word) {
|
||||
const words = this.get("filteredContent") || [];
|
||||
const words = this.filteredContent || [];
|
||||
const filtered = words.filter(
|
||||
content => content.action === this.get("actionKey")
|
||||
content => content.action === this.actionKey
|
||||
);
|
||||
return filtered.every(
|
||||
content => content.word.toLowerCase() !== word.toLowerCase()
|
||||
@ -39,7 +39,7 @@ export default Ember.Component.extend({
|
||||
|
||||
actions: {
|
||||
submit() {
|
||||
if (!this.get("isUniqueWord")) {
|
||||
if (!this.isUniqueWord) {
|
||||
this.setProperties({
|
||||
showMessage: true,
|
||||
message: I18n.t("admin.watched_words.form.exists")
|
||||
@ -47,12 +47,12 @@ export default Ember.Component.extend({
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.get("formSubmitted")) {
|
||||
if (!this.formSubmitted) {
|
||||
this.set("formSubmitted", true);
|
||||
|
||||
const watchedWord = WatchedWord.create({
|
||||
word: this.get("word"),
|
||||
action: this.get("actionKey")
|
||||
word: this.word,
|
||||
action: this.actionKey
|
||||
});
|
||||
|
||||
watchedWord
|
||||
|
Reference in New Issue
Block a user