Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Apr 19, 2019
1 parent 63ab773 commit d33df45
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/Notifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand All @@ -150,7 +150,7 @@ const Notifier = {
audioElement.play();
}).catch((ex) => {
console.warn("Caught error when trying to fetch room notification sound:", ex);
})
});
},

start: function() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/dialogs/RoomSettingsDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -54,7 +54,7 @@ export default class RoomSettingsDialog extends React.Component {
_td("Notifications"),
"mx_RoomSettingsDialog_rolesIcon",
<NotificationSettingsTab roomId={this.props.roomId} />,
))
));
tabs.push(new Tab(
_td("Advanced"),
"mx_RoomSettingsDialog_warningIcon",
Expand Down
15 changes: 5 additions & 10 deletions src/components/views/settings/tabs/room/NotificationSettingsTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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({
Expand All @@ -110,8 +107,6 @@ export default class NotificationsSettingsTab extends React.Component {
}

render() {
const client = MatrixClientPeg.get();

return (
<div className="mx_SettingsTab">
<div className="mx_SettingsTab_heading">{_t("Notifications")}</div>
Expand Down

0 comments on commit d33df45

Please sign in to comment.