From d33df45c5e0162a6f681c5007e8b6fc5dc60012f Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Fri, 19 Apr 2019 21:42:18 +0100 Subject: [PATCH] Linting --- src/Notifier.js | 6 +++--- .../views/dialogs/RoomSettingsDialog.js | 4 ++-- .../settings/tabs/room/NotificationSettingsTab.js | 15 +++++---------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/Notifier.js b/src/Notifier.js index 041b91f4b2c..43d599ae0d5 100644 --- a/src/Notifier.js +++ b/src/Notifier.js @@ -120,7 +120,7 @@ const Notifier = { console.warn(`${room.roomId} has custom notification sound event, but no url key`); return null; } - + return { url: MatrixClientPeg.get().mxcUrlToHttp(content.url), name: content.name, @@ -138,7 +138,7 @@ const Notifier = { let audioElement = selector; if (!selector) { if (!sound) { - console.error("Tried to play alert sound but missing #messageAudio") + console.error("Tried to play alert sound but missing #messageAudio"); return; } audioElement = new Audio(sound.url); @@ -150,7 +150,7 @@ const Notifier = { audioElement.play(); }).catch((ex) => { console.warn("Caught error when trying to fetch room notification sound:", ex); - }) + }); }, start: function() { diff --git a/src/components/views/dialogs/RoomSettingsDialog.js b/src/components/views/dialogs/RoomSettingsDialog.js index 733c5002f57..caed9580031 100644 --- a/src/components/views/dialogs/RoomSettingsDialog.js +++ b/src/components/views/dialogs/RoomSettingsDialog.js @@ -23,7 +23,7 @@ import RolesRoomSettingsTab from "../settings/tabs/room/RolesRoomSettingsTab"; import GeneralRoomSettingsTab from "../settings/tabs/room/GeneralRoomSettingsTab"; import SecurityRoomSettingsTab from "../settings/tabs/room/SecurityRoomSettingsTab"; import NotificationSettingsTab from "../settings/tabs/room/NotificationSettingsTab"; -import sdk from "../../../index";RolesRoomSettingsTab +import sdk from "../../../index"; import MatrixClientPeg from "../../../MatrixClientPeg"; export default class RoomSettingsDialog extends React.Component { @@ -54,7 +54,7 @@ export default class RoomSettingsDialog extends React.Component { _td("Notifications"), "mx_RoomSettingsDialog_rolesIcon", , - )) + )); tabs.push(new Tab( _td("Advanced"), "mx_RoomSettingsDialog_warningIcon", diff --git a/src/components/views/settings/tabs/room/NotificationSettingsTab.js b/src/components/views/settings/tabs/room/NotificationSettingsTab.js index 35a223a1d85..a911ec3e4f9 100644 --- a/src/components/views/settings/tabs/room/NotificationSettingsTab.js +++ b/src/components/views/settings/tabs/room/NotificationSettingsTab.js @@ -18,10 +18,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import {_t} from "../../../../../languageHandler"; import MatrixClientPeg from "../../../../../MatrixClientPeg"; -import sdk from "../../../../.."; import AccessibleButton from "../../../elements/AccessibleButton"; -import Modal from "../../../../../Modal"; -import dis from "../../../../../dispatcher"; import Notifier from "../../../../../Notifier"; export default class NotificationsSettingsTab extends React.Component { @@ -45,8 +42,8 @@ export default class NotificationsSettingsTab extends React.Component { if (!soundData) { return; } - this.setState({currentSound: soundData.name || soundData.url}) - }) + this.setState({currentSound: soundData.name || soundData.url}); + }); } _onSoundUploadChanged(e) { @@ -63,7 +60,7 @@ export default class NotificationsSettingsTab extends React.Component { }); } - async _saveSound (e) { + async _saveSound(e) { e.stopPropagation(); e.preventDefault(); if (!this.state.uploadedFile) { @@ -98,10 +95,10 @@ export default class NotificationsSettingsTab extends React.Component { }); } - _clearSound (e) { + _clearSound(e) { e.stopPropagation(); e.preventDefault(); - const room = client.getRoom(this.props.roomId); + const room = MatrixClientPeg.get().getRoom(this.props.roomId); Notifier.clearRoomSound(room); this.setState({ @@ -110,8 +107,6 @@ export default class NotificationsSettingsTab extends React.Component { } render() { - const client = MatrixClientPeg.get(); - return (
{_t("Notifications")}