diff --git a/.eslintignore.errorfiles b/.eslintignore.errorfiles index d5eeebf1f2..c7d5804d66 100644 --- a/.eslintignore.errorfiles +++ b/.eslintignore.errorfiles @@ -18,7 +18,6 @@ src/components/views/create_room/RoomAlias.js src/components/views/dialogs/DeactivateAccountDialog.js src/components/views/dialogs/SetPasswordDialog.js src/components/views/dialogs/UnknownDeviceDialog.js -src/components/views/directory/NetworkDropdown.js src/components/views/elements/AddressSelector.js src/components/views/elements/DirectorySearchBox.js src/components/views/elements/ImageView.js diff --git a/src/components/views/directory/NetworkDropdown.js b/src/components/views/directory/NetworkDropdown.js index b2999e31cb..ebfff5ae8c 100644 --- a/src/components/views/directory/NetworkDropdown.js +++ b/src/components/views/directory/NetworkDropdown.js @@ -137,7 +137,7 @@ export default class NetworkDropdown extends React.Component { servers = servers.concat(this.props.config.roomDirectory.servers); } - if (servers.indexOf(MatrixClientPeg.getHomeServerName()) == -1) { + if (!servers.includes(MatrixClientPeg.getHomeServerName())) { servers.unshift(MatrixClientPeg.getHomeServerName()); } @@ -147,7 +147,7 @@ export default class NetworkDropdown extends React.Component { // we can only show the default room list. for (const server of servers) { options.push(this._makeMenuOption(server, null, true)); - if (server == MatrixClientPeg.getHomeServerName()) { + if (server === MatrixClientPeg.getHomeServerName()) { options.push(this._makeMenuOption(server, null, false)); if (this.props.protocols) { for (const proto of Object.keys(this.props.protocols)) { @@ -183,18 +183,15 @@ export default class NetworkDropdown extends React.Component { let icon; let name; - let span_class; let key; if (!instance && includeAll) { key = server; name = server; - span_class = 'mx_NetworkDropdown_menu_all'; } else if (!instance) { key = server + '_all'; name = 'Matrix'; icon = ; - span_class = 'mx_NetworkDropdown_menu_network'; } else { key = server + '_inst_' + instance.instance_id; const imgUrl = instance.icon ? @@ -202,41 +199,40 @@ export default class NetworkDropdown extends React.Component { DEFAULT_ICON_URL; icon = ; name = instance.desc; - span_class = 'mx_NetworkDropdown_menu_network'; } - const click_handler = handleClicks ? this.onMenuOptionClick.bind(this, server, instance, includeAll) : null; + const clickHandler = handleClicks ? this.onMenuOptionClick.bind(this, server, instance, includeAll) : null; - return
+ return
{icon} {name}
; } render() { - let current_value; + let currentValue; let menu; if (this.state.expanded) { - const menu_options = this._getMenuOptions(); + const menuOptions = this._getMenuOptions(); menu =
- {menu_options} + {menuOptions}
; - current_value = ; } else { const instance = instanceForInstanceId(this.props.protocols, this.state.selectedInstanceId); - current_value = this._makeMenuOption( + currentValue = this._makeMenuOption( this.state.selectedServer, instance, this.state.includeAllNetworks, false, ); } return
- {current_value} - + {currentValue} + {menu}
;