From dad797d4a201ad1f7d0877c9589e23c588225307 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 16 Nov 2017 13:19:36 +0000 Subject: [PATCH] Run linting --fix --- src/ComposerHistoryManager.js | 2 +- src/MatrixClientPeg.js | 4 ++-- src/RichText.js | 2 +- src/TextForEvent.js | 4 ++-- src/Tinter.js | 2 +- src/autocomplete/UserProvider.js | 2 +- src/components/structures/MatrixChat.js | 2 +- src/components/structures/RoomView.js | 14 +++++++------- src/components/structures/ScrollPanel.js | 2 +- src/components/structures/TimelinePanel.js | 6 +++--- src/components/structures/UserSettings.js | 2 +- src/components/structures/login/ForgotPassword.js | 2 +- src/components/structures/login/Login.js | 13 ++++++------- src/components/structures/login/Registration.js | 3 +-- src/components/views/dialogs/KeyShareDialog.js | 2 +- src/components/views/elements/AppPermission.js | 6 +++--- src/components/views/elements/AppTile.js | 4 ++-- src/components/views/elements/LanguageDropdown.js | 6 +++--- .../views/elements/MemberEventListSummary.js | 4 ++-- src/components/views/login/PasswordLogin.js | 6 +++--- src/components/views/login/RegistrationForm.js | 2 +- src/components/views/messages/SenderProfile.js | 2 +- src/components/views/rooms/AppsDrawer.js | 4 ++-- src/components/views/rooms/EventTile.js | 2 +- src/components/views/rooms/MemberInfo.js | 2 +- src/components/views/rooms/MessageComposer.js | 4 ++-- src/components/views/rooms/MessageComposerInput.js | 4 ++-- src/components/views/rooms/RoomHeader.js | 2 +- src/components/views/rooms/RoomPreviewBar.js | 4 ++-- src/components/views/rooms/RoomSettings.js | 8 ++++---- src/components/views/rooms/RoomTile.js | 2 +- src/components/views/voip/VideoFeed.js | 2 +- src/utils/MegolmExportEncryption.js | 2 +- src/utils/createMatrixClient.js | 2 +- 34 files changed, 64 insertions(+), 66 deletions(-) diff --git a/src/ComposerHistoryManager.js b/src/ComposerHistoryManager.js index 2fff3882b4..2757c5bd3d 100644 --- a/src/ComposerHistoryManager.js +++ b/src/ComposerHistoryManager.js @@ -61,7 +61,7 @@ export default class ComposerHistoryManager { // TODO: Performance issues? let item; - for(; item = sessionStorage.getItem(`${this.prefix}[${this.currentIndex}]`); this.currentIndex++) { + for (; item = sessionStorage.getItem(`${this.prefix}[${this.currentIndex}]`); this.currentIndex++) { this.history.push( Object.assign(new HistoryItem(), JSON.parse(item)), ); diff --git a/src/MatrixClientPeg.js b/src/MatrixClientPeg.js index 7a4f0b99b0..86b38d4150 100644 --- a/src/MatrixClientPeg.js +++ b/src/MatrixClientPeg.js @@ -84,7 +84,7 @@ class MatrixClientPeg { if (this.matrixClient.initCrypto) { await this.matrixClient.initCrypto(); } - } catch(e) { + } catch (e) { // this can happen for a number of reasons, the most likely being // that the olm library was missing. It's not fatal. console.warn("Unable to initialise e2e: " + e); @@ -99,7 +99,7 @@ class MatrixClientPeg { const promise = this.matrixClient.store.startup(); console.log(`MatrixClientPeg: waiting for MatrixClient store to initialise`); await promise; - } catch(err) { + } catch (err) { // log any errors when starting up the database (if one exists) console.error(`Error starting matrixclient store: ${err}`); } diff --git a/src/RichText.js b/src/RichText.js index b61ba0b9a4..12274ee9f3 100644 --- a/src/RichText.js +++ b/src/RichText.js @@ -68,7 +68,7 @@ function unicodeToEmojiUri(str) { return unicodeChar; } else { // Remove variant selector VS16 (explicitly emoji) as it is unnecessary and leads to an incorrect URL below - if(unicodeChar.length == 2 && unicodeChar[1] == '\ufe0f') { + if (unicodeChar.length == 2 && unicodeChar[1] == '\ufe0f') { unicodeChar = unicodeChar[0]; } diff --git a/src/TextForEvent.js b/src/TextForEvent.js index 51e3eb8dc9..1bdf5ad90c 100644 --- a/src/TextForEvent.js +++ b/src/TextForEvent.js @@ -151,9 +151,9 @@ function textForCallHangupEvent(event) { const senderName = event.sender ? event.sender.name : _t('Someone'); const eventContent = event.getContent(); let reason = ""; - if(!MatrixClientPeg.get().supportsVoip()) { + if (!MatrixClientPeg.get().supportsVoip()) { reason = _t('(not supported by this browser)'); - } else if(eventContent.reason) { + } else if (eventContent.reason) { if (eventContent.reason === "ice_failed") { reason = _t('(could not connect media)'); } else if (eventContent.reason === "invite_timeout") { diff --git a/src/Tinter.js b/src/Tinter.js index 5c9b436d45..c7402c15be 100644 --- a/src/Tinter.js +++ b/src/Tinter.js @@ -393,7 +393,7 @@ class Tinter { let svgDoc; try { svgDoc = svgs[i].contentDocument; - } catch(e) { + } catch (e) { let msg = 'Failed to get svg.contentDocument of ' + svgs[i].toString(); if (e.message) { msg += e.message; diff --git a/src/autocomplete/UserProvider.js b/src/autocomplete/UserProvider.js index 8b43964b1a..9d587c2eb4 100644 --- a/src/autocomplete/UserProvider.js +++ b/src/autocomplete/UserProvider.js @@ -126,7 +126,7 @@ export default class UserProvider extends AutocompleteProvider { const events = this.room.getLiveTimeline().getEvents(); const lastSpoken = {}; - for(const event of events) { + for (const event of events) { lastSpoken[event.getSender()] = event.getTs(); } diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 37005b0d69..32762a081c 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -317,7 +317,7 @@ module.exports = React.createClass({ // the first thing to do is to try the token params in the query-string Lifecycle.attemptTokenLogin(this.props.realQueryParams).then((loggedIn) => { - if(loggedIn) { + if (loggedIn) { this.props.onTokenLoginCompleted(); // don't do anything else until the page reloads - just stay in diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 38a3392e43..1381b4fce0 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -303,7 +303,7 @@ module.exports = React.createClass({ // Check if user has previously chosen to hide the app drawer for this // room. If so, do not show apps - let hideWidgetDrawer = localStorage.getItem( + const hideWidgetDrawer = localStorage.getItem( room.roomId + "_hide_widget_drawer"); if (hideWidgetDrawer === "true") { @@ -713,7 +713,7 @@ module.exports = React.createClass({ return; } - const joinedMembers = room.currentState.getMembers().filter(m => m.membership === "join" || m.membership === "invite"); + const joinedMembers = room.currentState.getMembers().filter((m) => m.membership === "join" || m.membership === "invite"); this.setState({isAlone: joinedMembers.length === 1}); }, @@ -1110,7 +1110,7 @@ module.exports = React.createClass({ } if (this.state.searchScope === 'All') { - if(roomId != lastRoomId) { + if (roomId != lastRoomId) { const room = cli.getRoom(roomId); // XXX: if we've left the room, we might not know about @@ -1421,13 +1421,13 @@ module.exports = React.createClass({ */ handleScrollKey: function(ev) { let panel; - if(this.refs.searchResultsPanel) { + if (this.refs.searchResultsPanel) { panel = this.refs.searchResultsPanel; - } else if(this.refs.messagePanel) { + } else if (this.refs.messagePanel) { panel = this.refs.messagePanel; } - if(panel) { + if (panel) { panel.handleScrollKey(ev); } }, @@ -1446,7 +1446,7 @@ module.exports = React.createClass({ // otherwise react calls it with null on each update. _gatherTimelinePanelRef: function(r) { this.refs.messagePanel = r; - if(r) { + if (r) { console.log("updateTint from RoomView._gatherTimelinePanelRef"); this.updateTint(); } diff --git a/src/components/structures/ScrollPanel.js b/src/components/structures/ScrollPanel.js index cda60c606f..dfc6b0f7a1 100644 --- a/src/components/structures/ScrollPanel.js +++ b/src/components/structures/ScrollPanel.js @@ -573,7 +573,7 @@ module.exports = React.createClass({ debuglog("ScrollPanel: scrolling to token '" + scrollToken + "'+" + pixelOffset + " (delta: "+scrollDelta+")"); - if(scrollDelta != 0) { + if (scrollDelta != 0) { this._setScrollTop(scrollNode.scrollTop + scrollDelta); } }, diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index 56661b0d26..aeb6cce6c3 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -310,7 +310,7 @@ var TimelinePanel = React.createClass({ return Promise.resolve(false); } - if(!this._timelineWindow.canPaginate(dir)) { + if (!this._timelineWindow.canPaginate(dir)) { debuglog("TimelinePanel: can't", dir, "paginate any further"); this.setState({[canPaginateKey]: false}); return Promise.resolve(false); @@ -440,7 +440,7 @@ var TimelinePanel = React.createClass({ var callback = null; if (sender != myUserId && !UserActivity.userCurrentlyActive()) { updatedState.readMarkerVisible = true; - } else if(lastEv && this.getReadMarkerPosition() === 0) { + } else if (lastEv && this.getReadMarkerPosition() === 0) { // we know we're stuckAtBottom, so we can advance the RM // immediately, to save a later render cycle @@ -657,7 +657,7 @@ var TimelinePanel = React.createClass({ // the read-marker should become invisible, so that if the user scrolls // down, they don't see it. - if(this.state.readMarkerVisible) { + if (this.state.readMarkerVisible) { this.setState({ readMarkerVisible: false, }); diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 692dd4e01d..d88eb5c7f8 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -612,7 +612,7 @@ module.exports = React.createClass({ }, onLanguageChange: function(newLang) { - if(this.state.language !== newLang) { + if (this.state.language !== newLang) { // We intentionally promote this to the account level at this point SettingsStore.setValue("language", null, SettingLevel.ACCOUNT, newLang); this.setState({ diff --git a/src/components/structures/login/ForgotPassword.js b/src/components/structures/login/ForgotPassword.js index 8a2714d96a..43753bfd38 100644 --- a/src/components/structures/login/ForgotPassword.js +++ b/src/components/structures/login/ForgotPassword.js @@ -154,7 +154,7 @@ module.exports = React.createClass({ }, render: function() { - const LoginPage = sdk.getComponent("login.LoginPage"); + const LoginPage = sdk.getComponent("login.LoginPage"); const LoginHeader = sdk.getComponent("login.LoginHeader"); const LoginFooter = sdk.getComponent("login.LoginFooter"); const ServerConfig = sdk.getComponent("login.ServerConfig"); diff --git a/src/components/structures/login/Login.js b/src/components/structures/login/Login.js index 53f1b0e380..baa2064277 100644 --- a/src/components/structures/login/Login.js +++ b/src/components/structures/login/Login.js @@ -96,7 +96,7 @@ module.exports = React.createClass({ ).then((data) => { this.props.onLoggedIn(data); }, (error) => { - if(this._unmounted) { + if (this._unmounted) { return; } let errorText; @@ -113,14 +113,14 @@ module.exports = React.createClass({
{ _t('Please note you are logging into the %(hs)s server, not matrix.org.', { - hs: this.props.defaultHsUrl.replace(/^https?:\/\//, '') + hs: this.props.defaultHsUrl.replace(/^https?:\/\//, ''), }) }
); } else { - errorText = _t('Incorrect username and/or password.'); + errorText = _t('Incorrect username and/or password.'); } } else { // other errors, not specific to doing a password login @@ -136,7 +136,7 @@ module.exports = React.createClass({ loginIncorrect: error.httpStatus === 401 || error.httpStatus == 403, }); }).finally(() => { - if(this._unmounted) { + if (this._unmounted) { return; } this.setState({ @@ -332,7 +332,7 @@ module.exports = React.createClass({ }, _onLanguageChange: function(newLang) { - if(languageHandler.getCurrentLanguage() !== newLang) { + if (languageHandler.getCurrentLanguage() !== newLang) { SettingsStore.setValue("language", null, SettingLevel.DEVICE, newLang); PlatformPeg.get().reload(); } @@ -393,8 +393,7 @@ module.exports = React.createClass({ const theme = SettingsStore.getValue("theme"); if (theme !== "status") { header =

{ _t('Sign in') }

; - } - else { + } else { if (!this.state.errorText) { header =

{ _t('Sign in to get started') }

; } diff --git a/src/components/structures/login/Registration.js b/src/components/structures/login/Registration.js index 709bb0b7f6..e57b7fd0c2 100644 --- a/src/components/structures/login/Registration.js +++ b/src/components/structures/login/Registration.js @@ -399,8 +399,7 @@ module.exports = React.createClass({ // FIXME: remove hardcoded Status team tweaks at some point if (theme === 'status' && this.state.errorText) { header =
{ this.state.errorText }
; - } - else { + } else { header =

{ _t('Create an account') }

; if (this.state.errorText) { errorText =
{ this.state.errorText }
; diff --git a/src/components/views/dialogs/KeyShareDialog.js b/src/components/views/dialogs/KeyShareDialog.js index b0dc0a304e..9c8be27c89 100644 --- a/src/components/views/dialogs/KeyShareDialog.js +++ b/src/components/views/dialogs/KeyShareDialog.js @@ -54,7 +54,7 @@ export default React.createClass({ const deviceInfo = r[userId][deviceId]; - if(!deviceInfo) { + if (!deviceInfo) { console.warn(`No details found for device ${userId}:${deviceId}`); this.props.onFinished(false); diff --git a/src/components/views/elements/AppPermission.js b/src/components/views/elements/AppPermission.js index f1117fd5aa..ef08c8355b 100644 --- a/src/components/views/elements/AppPermission.js +++ b/src/components/views/elements/AppPermission.js @@ -19,9 +19,9 @@ export default class AppPermission extends React.Component { const searchParams = new URLSearchParams(wurl.search); - if(this.isScalarWurl(wurl) && searchParams && searchParams.get('url')) { + if (this.isScalarWurl(wurl) && searchParams && searchParams.get('url')) { curl = url.parse(searchParams.get('url')); - if(curl) { + if (curl) { curl.search = curl.query = ""; curlString = curl.format(); } @@ -34,7 +34,7 @@ export default class AppPermission extends React.Component { } isScalarWurl(wurl) { - if(wurl && wurl.hostname && ( + if (wurl && wurl.hostname && ( wurl.hostname === 'scalar.vector.im' || wurl.hostname === 'scalar-staging.riot.im' || wurl.hostname === 'scalar-develop.riot.im' || diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index e31b50be37..a005406133 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -284,7 +284,7 @@ export default React.createClass({ formatAppTileName() { let appTileName = "No name"; - if(this.props.name && this.props.name.trim()) { + if (this.props.name && this.props.name.trim()) { appTileName = this.props.name.trim(); } return appTileName; @@ -374,7 +374,7 @@ export default React.createClass({ const deleteWidgetLabel = this._deleteWidgetLabel(); let deleteIcon = 'img/cancel_green.svg'; let deleteClasses = 'mx_AppTileMenuBarWidget'; - if(this._canUserModify()) { + if (this._canUserModify()) { deleteIcon = 'img/icon-delete-pink.svg'; deleteClasses += ' mx_AppTileMenuBarWidgetDelete'; } diff --git a/src/components/views/elements/LanguageDropdown.js b/src/components/views/elements/LanguageDropdown.js index 8f2ba006cf..6c86296a38 100644 --- a/src/components/views/elements/LanguageDropdown.js +++ b/src/components/views/elements/LanguageDropdown.js @@ -41,8 +41,8 @@ export default class LanguageDropdown extends React.Component { componentWillMount() { languageHandler.getAllLanguagesFromJson().then((langs) => { langs.sort(function(a, b) { - if(a.label < b.label) return -1; - if(a.label > b.label) return 1; + if (a.label < b.label) return -1; + if (a.label > b.label) return 1; return 0; }); this.setState({langs}); @@ -57,7 +57,7 @@ export default class LanguageDropdown extends React.Component { const language = SettingsStore.getValue("language", null, /*excludeDefault:*/true); if (language) { this.props.onOptionChange(language); - }else { + } else { const language = languageHandler.normalizeLanguageKey(languageHandler.getLanguageFromBrowser()); this.props.onOptionChange(language); } diff --git a/src/components/views/elements/MemberEventListSummary.js b/src/components/views/elements/MemberEventListSummary.js index de6f801a21..b25b816a34 100644 --- a/src/components/views/elements/MemberEventListSummary.js +++ b/src/components/views/elements/MemberEventListSummary.js @@ -216,7 +216,7 @@ module.exports = React.createClass({ // are there only to show translators to non-English languages // that the verb is conjugated to plural or singular Subject. let res = null; - switch(t) { + switch (t) { case "joined": res = (userCount > 1) ? _t("%(severalUsers)sjoined %(count)s times", { severalUsers: "", count: repeats }) @@ -304,7 +304,7 @@ module.exports = React.createClass({ return items[0]; } else if (remaining > 0) { items = items.slice(0, itemLimit); - return _t("%(items)s and %(count)s others", { items: items.join(', '), count: remaining } ) + return _t("%(items)s and %(count)s others", { items: items.join(', '), count: remaining } ); } else { const lastItem = items.pop(); return _t("%(items)s and %(lastItem)s", { items: items.join(', '), lastItem: lastItem }); diff --git a/src/components/views/login/PasswordLogin.js b/src/components/views/login/PasswordLogin.js index 77b695ef12..83bb41c1a3 100644 --- a/src/components/views/login/PasswordLogin.js +++ b/src/components/views/login/PasswordLogin.js @@ -122,7 +122,7 @@ class PasswordLogin extends React.Component { mx_Login_field_disabled: disabled, }; - switch(loginType) { + switch (loginType) { case PasswordLogin.LOGIN_FIELD_EMAIL: classes.mx_Login_email = true; return nameElem }); } else { // There is nothing to translate here, so call substitute() instead diff --git a/src/components/views/rooms/AppsDrawer.js b/src/components/views/rooms/AppsDrawer.js index 9a3ba5f329..423f345b1d 100644 --- a/src/components/views/rooms/AppsDrawer.js +++ b/src/components/views/rooms/AppsDrawer.js @@ -133,7 +133,7 @@ module.exports = React.createClass({ '$matrix_avatar_url': user ? MatrixClientPeg.get().mxcUrlToHttp(user.avatarUrl) : '', }; - if(app.data) { + if (app.data) { Object.keys(app.data).forEach((key) => { params['$' + key] = app.data[key]; }); @@ -177,7 +177,7 @@ module.exports = React.createClass({ _canUserModify: function() { try { return WidgetUtils.canUserModifyWidgets(this.props.room.roomId); - } catch(err) { + } catch (err) { console.error(err); return false; } diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 812d72a26a..51d12c4f76 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -44,7 +44,7 @@ const eventTileTypes = { 'm.room.history_visibility': 'messages.TextualEvent', 'm.room.encryption': 'messages.TextualEvent', 'm.room.power_levels': 'messages.TextualEvent', - 'm.room.pinned_events' : 'messages.TextualEvent', + 'm.room.pinned_events': 'messages.TextualEvent', 'im.vector.modular.widgets': 'messages.TextualEvent', }; diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js index 4d875ea24a..cb6cb6c0f3 100644 --- a/src/components/views/rooms/MemberInfo.js +++ b/src/components/views/rooms/MemberInfo.js @@ -562,7 +562,7 @@ module.exports = withMatrixClient(React.createClass({ onMemberAvatarClick: function() { const member = this.props.member; const avatarUrl = member.user ? member.user.avatarUrl : member.events.member.getContent().avatar_url; - if(!avatarUrl) return; + if (!avatarUrl) return; const httpUrl = this.props.matrixClient.mxcUrlToHttp(avatarUrl); const ImageView = sdk.getComponent("elements.ImageView"); diff --git a/src/components/views/rooms/MessageComposer.js b/src/components/views/rooms/MessageComposer.js index 2ac7075189..2841f30423 100644 --- a/src/components/views/rooms/MessageComposer.js +++ b/src/components/views/rooms/MessageComposer.js @@ -111,10 +111,10 @@ export default class MessageComposer extends React.Component { ), onFinished: (shouldUpload) => { - if(shouldUpload) { + if (shouldUpload) { // MessageComposer shouldn't have to rely on its parent passing in a callback to upload a file if (files) { - for(let i=0; i hex unicode const emojiUc = asciiList[emojiMatch[1]]; // hex unicode -> shortname -> actual unicode @@ -696,7 +696,7 @@ export default class MessageComposerInput extends React.Component { } const currentBlockType = RichUtils.getCurrentBlockType(this.state.editorState); - if( + if ( ['code-block', 'blockquote', 'unordered-list-item', 'ordered-list-item'] .includes(currentBlockType) ) { diff --git a/src/components/views/rooms/RoomHeader.js b/src/components/views/rooms/RoomHeader.js index a44673c879..aee229c5da 100644 --- a/src/components/views/rooms/RoomHeader.js +++ b/src/components/views/rooms/RoomHeader.js @@ -389,7 +389,7 @@ module.exports = React.createClass({ let rightRow; let manageIntegsButton; - if(this.props.room && this.props.room.roomId && this.props.inRoom) { + if (this.props.room && this.props.room.roomId && this.props.inRoom) { manageIntegsButton = ; diff --git a/src/components/views/rooms/RoomPreviewBar.js b/src/components/views/rooms/RoomPreviewBar.js index fe7948aeb3..175a3ea552 100644 --- a/src/components/views/rooms/RoomPreviewBar.js +++ b/src/components/views/rooms/RoomPreviewBar.js @@ -165,13 +165,13 @@ module.exports = React.createClass({ let actionText; if (kicked) { - if(roomName) { + if (roomName) { actionText = _t("You have been kicked from %(roomName)s by %(userName)s.", {roomName: roomName, userName: kickerName}); } else { actionText = _t("You have been kicked from this room by %(userName)s.", {userName: kickerName}); } } else if (banned) { - if(roomName) { + if (roomName) { actionText = _t("You have been banned from %(roomName)s by %(userName)s.", {roomName: roomName, userName: kickerName}); } else { actionText = _t("You have been banned from this room by %(userName)s.", {userName: kickerName}); diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index 22550a1b65..4ac2da2030 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -309,9 +309,9 @@ module.exports = React.createClass({ } // url preview settings - let ps = this.saveUrlPreviewSettings(); + const ps = this.saveUrlPreviewSettings(); if (ps.length > 0) { - ps.map(p => promises.push(p)); + ps.map((p) => promises.push(p)); } // related groups @@ -584,7 +584,7 @@ module.exports = React.createClass({ const roomState = this.props.room.currentState; const isEncrypted = cli.isRoomEncrypted(this.props.room.roomId); - let settings = ( + const settings = ( diff --git a/src/components/views/rooms/RoomTile.js b/src/components/views/rooms/RoomTile.js index 8034dd0fa6..743ec93da9 100644 --- a/src/components/views/rooms/RoomTile.js +++ b/src/components/views/rooms/RoomTile.js @@ -54,7 +54,7 @@ module.exports = React.createClass({ }, getInitialState: function() { - return({ + return ({ hover: false, badgeHover: false, menuDisplayed: false, diff --git a/src/components/views/voip/VideoFeed.js b/src/components/views/voip/VideoFeed.js index 953dbc866f..f955df62d9 100644 --- a/src/components/views/voip/VideoFeed.js +++ b/src/components/views/voip/VideoFeed.js @@ -39,7 +39,7 @@ module.exports = React.createClass({ }, onResize: function(e) { - if(this.props.onResize) { + if (this.props.onResize) { this.props.onResize(e); } }, diff --git a/src/utils/MegolmExportEncryption.js b/src/utils/MegolmExportEncryption.js index 11f9d86816..01c521da0c 100644 --- a/src/utils/MegolmExportEncryption.js +++ b/src/utils/MegolmExportEncryption.js @@ -116,7 +116,7 @@ export async function decryptMegolmKeyFile(data, password) { aesKey, ciphertext, ); - } catch(e) { + } catch (e) { throw friendlyError('subtleCrypto.decrypt failed: ' + e, cryptoFailMsg()); } diff --git a/src/utils/createMatrixClient.js b/src/utils/createMatrixClient.js index 2d294e262b..77b8cdb120 100644 --- a/src/utils/createMatrixClient.js +++ b/src/utils/createMatrixClient.js @@ -23,7 +23,7 @@ const localStorage = window.localStorage; let indexedDB; try { indexedDB = window.indexedDB; -} catch(e) {} +} catch (e) {} /** * Create a new matrix client, with the persistent stores set up appropriately