A platform for community discussion. Free, open, simple.
DEV: linting of discourse-presence (#10722)
Joffrey JAFFEUX4b94af077d48
diff --git a/plugins/discourse-presence/assets/javascripts/discourse/lib/presence.js.es6 b/plugins/discourse-presence/assets/javascripts/discourse/lib/presence.js.es6index 7b1fb0058f0..da8b7ef97c5 100644--- a/plugins/discourse-presence/assets/javascripts/discourse/lib/presence.js.es6+++ b/plugins/discourse-presence/assets/javascripts/discourse/lib/presence.js.es6@@ -54,7 +54,9 @@ const Presence = EmberObject.extend({this.channel,(message) => {const { user, state } = message;- if (this.get("currentUser.id") === user.id) return;+ if (this.get("currentUser.id") === user.id) {+ return;+ }switch (state) {case REPLYING:@@ -100,7 +102,9 @@ const Presence = EmberObject.extend({},publish(state, whisper, postId, staffOnly) {- if (this.get("currentUser.hide_profile_and_presence")) return;+ if (this.get("currentUser.hide_profile_and_presence")) {+ return;+ }const data = {state,@@ -128,7 +132,9 @@ const Presence = EmberObject.extend({_removeUser(user) {[this.users, this.editingUsers].forEach((users) => {const existingUser = users.findBy("id", user.id);- if (existingUser) users.removeObject(existingUser);+ if (existingUser) {+ users.removeObject(existingUser);+ }});},@@ -158,7 +164,9 @@ const Presence = EmberObject.extend({}if (attrs && attrs.post_id) {- if (u.post_id === attrs.post_id) usersLength++;+ if (u.post_id === attrs.post_id) {+ usersLength++;+ }} else {usersLength++;}diff --git a/plugins/discourse-presence/assets/javascripts/discourse/services/presence-manager.js.es6 b/plugins/discourse-presence/assets/javascripts/discourse/services/presence-manager.js.es6index 3968289c54c..fa8cc51c23b 100644--- a/plugins/discourse-presence/assets/javascripts/discourse/services/presence-manager.js.es6+++ b/plugins/discourse-presence/assets/javascripts/discourse/services/presence-manager.js.es6@@ -15,12 +15,16 @@ const PresenceManager = Service.extend({},subscribe(topicId, type) {- if (!topicId) return;+ if (!topicId) {+ return;+ }this._getPresence(topicId).subscribe(type);},unsubscribe(topicId, type) {- if (!topicId) return;+ if (!topicId) {+ return;+ }const presence = this._getPresence(topicId);if (presence.unsubscribe(type)) {@@ -29,17 +33,23 @@ const PresenceManager = Service.extend({},users(topicId) {- if (!topicId) return [];+ if (!topicId) {+ return [];+ }return this._getPresence(topicId).users;},editingUsers(topicId) {- if (!topicId) return [];+ if (!topicId) {+ return [];+ }return this._getPresence(topicId).editingUsers;},publish(topicId, state, whisper, postId, staffOnly) {- if (!topicId) return;+ if (!topicId) {+ return;+ }return this._getPresence(topicId).publish(state,whisper,