Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Weblate 2017-11-16 13:36:20 +00:00
commit b0f83dda03
34 changed files with 67 additions and 65 deletions

View file

@ -29,6 +29,10 @@ module.exports = {
// so we replace it with a version that is class property aware // so we replace it with a version that is class property aware
"babel/no-invalid-this": "error", "babel/no-invalid-this": "error",
// We appear to follow this most of the time, so let's enforce it instead
// of occasionally following it (or catching it in review)
"keyword-spacing": "error",
/** react **/ /** react **/
// This just uses the react plugin to help eslint known when // This just uses the react plugin to help eslint known when
// variables have been used in JSX // variables have been used in JSX

View file

@ -61,7 +61,7 @@ export default class ComposerHistoryManager {
// TODO: Performance issues? // TODO: Performance issues?
let item; 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( this.history.push(
Object.assign(new HistoryItem(), JSON.parse(item)), Object.assign(new HistoryItem(), JSON.parse(item)),
); );

View file

@ -84,7 +84,7 @@ class MatrixClientPeg {
if (this.matrixClient.initCrypto) { if (this.matrixClient.initCrypto) {
await this.matrixClient.initCrypto(); await this.matrixClient.initCrypto();
} }
} catch(e) { } catch (e) {
// this can happen for a number of reasons, the most likely being // this can happen for a number of reasons, the most likely being
// that the olm library was missing. It's not fatal. // that the olm library was missing. It's not fatal.
console.warn("Unable to initialise e2e: " + e); console.warn("Unable to initialise e2e: " + e);
@ -99,7 +99,7 @@ class MatrixClientPeg {
const promise = this.matrixClient.store.startup(); const promise = this.matrixClient.store.startup();
console.log(`MatrixClientPeg: waiting for MatrixClient store to initialise`); console.log(`MatrixClientPeg: waiting for MatrixClient store to initialise`);
await promise; await promise;
} catch(err) { } catch (err) {
// log any errors when starting up the database (if one exists) // log any errors when starting up the database (if one exists)
console.error(`Error starting matrixclient store: ${err}`); console.error(`Error starting matrixclient store: ${err}`);
} }

View file

@ -68,7 +68,7 @@ function unicodeToEmojiUri(str) {
return unicodeChar; return unicodeChar;
} else { } else {
// Remove variant selector VS16 (explicitly emoji) as it is unnecessary and leads to an incorrect URL below // 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]; unicodeChar = unicodeChar[0];
} }

View file

@ -151,9 +151,9 @@ function textForCallHangupEvent(event) {
const senderName = event.sender ? event.sender.name : _t('Someone'); const senderName = event.sender ? event.sender.name : _t('Someone');
const eventContent = event.getContent(); const eventContent = event.getContent();
let reason = ""; let reason = "";
if(!MatrixClientPeg.get().supportsVoip()) { if (!MatrixClientPeg.get().supportsVoip()) {
reason = _t('(not supported by this browser)'); reason = _t('(not supported by this browser)');
} else if(eventContent.reason) { } else if (eventContent.reason) {
if (eventContent.reason === "ice_failed") { if (eventContent.reason === "ice_failed") {
reason = _t('(could not connect media)'); reason = _t('(could not connect media)');
} else if (eventContent.reason === "invite_timeout") { } else if (eventContent.reason === "invite_timeout") {

View file

@ -393,7 +393,7 @@ class Tinter {
let svgDoc; let svgDoc;
try { try {
svgDoc = svgs[i].contentDocument; svgDoc = svgs[i].contentDocument;
} catch(e) { } catch (e) {
let msg = 'Failed to get svg.contentDocument of ' + svgs[i].toString(); let msg = 'Failed to get svg.contentDocument of ' + svgs[i].toString();
if (e.message) { if (e.message) {
msg += e.message; msg += e.message;

View file

@ -126,7 +126,7 @@ export default class UserProvider extends AutocompleteProvider {
const events = this.room.getLiveTimeline().getEvents(); const events = this.room.getLiveTimeline().getEvents();
const lastSpoken = {}; const lastSpoken = {};
for(const event of events) { for (const event of events) {
lastSpoken[event.getSender()] = event.getTs(); lastSpoken[event.getSender()] = event.getTs();
} }

View file

@ -317,7 +317,7 @@ module.exports = React.createClass({
// the first thing to do is to try the token params in the query-string // the first thing to do is to try the token params in the query-string
Lifecycle.attemptTokenLogin(this.props.realQueryParams).then((loggedIn) => { Lifecycle.attemptTokenLogin(this.props.realQueryParams).then((loggedIn) => {
if(loggedIn) { if (loggedIn) {
this.props.onTokenLoginCompleted(); this.props.onTokenLoginCompleted();
// don't do anything else until the page reloads - just stay in // don't do anything else until the page reloads - just stay in

View file

@ -303,7 +303,7 @@ module.exports = React.createClass({
// Check if user has previously chosen to hide the app drawer for this // Check if user has previously chosen to hide the app drawer for this
// room. If so, do not show apps // room. If so, do not show apps
let hideWidgetDrawer = localStorage.getItem( const hideWidgetDrawer = localStorage.getItem(
room.roomId + "_hide_widget_drawer"); room.roomId + "_hide_widget_drawer");
if (hideWidgetDrawer === "true") { if (hideWidgetDrawer === "true") {
@ -713,7 +713,7 @@ module.exports = React.createClass({
return; 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}); this.setState({isAlone: joinedMembers.length === 1});
}, },
@ -1110,7 +1110,7 @@ module.exports = React.createClass({
} }
if (this.state.searchScope === 'All') { if (this.state.searchScope === 'All') {
if(roomId != lastRoomId) { if (roomId != lastRoomId) {
const room = cli.getRoom(roomId); const room = cli.getRoom(roomId);
// XXX: if we've left the room, we might not know about // XXX: if we've left the room, we might not know about
@ -1421,13 +1421,13 @@ module.exports = React.createClass({
*/ */
handleScrollKey: function(ev) { handleScrollKey: function(ev) {
let panel; let panel;
if(this.refs.searchResultsPanel) { if (this.refs.searchResultsPanel) {
panel = this.refs.searchResultsPanel; panel = this.refs.searchResultsPanel;
} else if(this.refs.messagePanel) { } else if (this.refs.messagePanel) {
panel = this.refs.messagePanel; panel = this.refs.messagePanel;
} }
if(panel) { if (panel) {
panel.handleScrollKey(ev); panel.handleScrollKey(ev);
} }
}, },
@ -1446,7 +1446,7 @@ module.exports = React.createClass({
// otherwise react calls it with null on each update. // otherwise react calls it with null on each update.
_gatherTimelinePanelRef: function(r) { _gatherTimelinePanelRef: function(r) {
this.refs.messagePanel = r; this.refs.messagePanel = r;
if(r) { if (r) {
console.log("updateTint from RoomView._gatherTimelinePanelRef"); console.log("updateTint from RoomView._gatherTimelinePanelRef");
this.updateTint(); this.updateTint();
} }

View file

@ -573,7 +573,7 @@ module.exports = React.createClass({
debuglog("ScrollPanel: scrolling to token '" + scrollToken + "'+" + debuglog("ScrollPanel: scrolling to token '" + scrollToken + "'+" +
pixelOffset + " (delta: "+scrollDelta+")"); pixelOffset + " (delta: "+scrollDelta+")");
if(scrollDelta != 0) { if (scrollDelta != 0) {
this._setScrollTop(scrollNode.scrollTop + scrollDelta); this._setScrollTop(scrollNode.scrollTop + scrollDelta);
} }
}, },

View file

@ -310,7 +310,7 @@ var TimelinePanel = React.createClass({
return Promise.resolve(false); return Promise.resolve(false);
} }
if(!this._timelineWindow.canPaginate(dir)) { if (!this._timelineWindow.canPaginate(dir)) {
debuglog("TimelinePanel: can't", dir, "paginate any further"); debuglog("TimelinePanel: can't", dir, "paginate any further");
this.setState({[canPaginateKey]: false}); this.setState({[canPaginateKey]: false});
return Promise.resolve(false); return Promise.resolve(false);
@ -440,7 +440,7 @@ var TimelinePanel = React.createClass({
var callback = null; var callback = null;
if (sender != myUserId && !UserActivity.userCurrentlyActive()) { if (sender != myUserId && !UserActivity.userCurrentlyActive()) {
updatedState.readMarkerVisible = true; 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 // we know we're stuckAtBottom, so we can advance the RM
// immediately, to save a later render cycle // 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 // the read-marker should become invisible, so that if the user scrolls
// down, they don't see it. // down, they don't see it.
if(this.state.readMarkerVisible) { if (this.state.readMarkerVisible) {
this.setState({ this.setState({
readMarkerVisible: false, readMarkerVisible: false,
}); });

View file

@ -612,7 +612,7 @@ module.exports = React.createClass({
}, },
onLanguageChange: function(newLang) { onLanguageChange: function(newLang) {
if(this.state.language !== newLang) { if (this.state.language !== newLang) {
SettingsStore.setValue("language", null, SettingLevel.DEVICE, newLang); SettingsStore.setValue("language", null, SettingLevel.DEVICE, newLang);
this.setState({ this.setState({
language: newLang, language: newLang,

View file

@ -154,7 +154,7 @@ module.exports = React.createClass({
}, },
render: function() { render: function() {
const LoginPage = sdk.getComponent("login.LoginPage"); const LoginPage = sdk.getComponent("login.LoginPage");
const LoginHeader = sdk.getComponent("login.LoginHeader"); const LoginHeader = sdk.getComponent("login.LoginHeader");
const LoginFooter = sdk.getComponent("login.LoginFooter"); const LoginFooter = sdk.getComponent("login.LoginFooter");
const ServerConfig = sdk.getComponent("login.ServerConfig"); const ServerConfig = sdk.getComponent("login.ServerConfig");

View file

@ -96,7 +96,7 @@ module.exports = React.createClass({
).then((data) => { ).then((data) => {
this.props.onLoggedIn(data); this.props.onLoggedIn(data);
}, (error) => { }, (error) => {
if(this._unmounted) { if (this._unmounted) {
return; return;
} }
let errorText; let errorText;
@ -113,14 +113,14 @@ module.exports = React.createClass({
<div className="mx_Login_smallError"> <div className="mx_Login_smallError">
{ _t('Please note you are logging into the %(hs)s server, not matrix.org.', { _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?:\/\//, ''),
}) })
} }
</div> </div>
</div> </div>
); );
} else { } else {
errorText = _t('Incorrect username and/or password.'); errorText = _t('Incorrect username and/or password.');
} }
} else { } else {
// other errors, not specific to doing a password login // other errors, not specific to doing a password login
@ -136,7 +136,7 @@ module.exports = React.createClass({
loginIncorrect: error.httpStatus === 401 || error.httpStatus == 403, loginIncorrect: error.httpStatus === 401 || error.httpStatus == 403,
}); });
}).finally(() => { }).finally(() => {
if(this._unmounted) { if (this._unmounted) {
return; return;
} }
this.setState({ this.setState({
@ -332,7 +332,7 @@ module.exports = React.createClass({
}, },
_onLanguageChange: function(newLang) { _onLanguageChange: function(newLang) {
if(languageHandler.getCurrentLanguage() !== newLang) { if (languageHandler.getCurrentLanguage() !== newLang) {
SettingsStore.setValue("language", null, SettingLevel.DEVICE, newLang); SettingsStore.setValue("language", null, SettingLevel.DEVICE, newLang);
PlatformPeg.get().reload(); PlatformPeg.get().reload();
} }
@ -393,8 +393,7 @@ module.exports = React.createClass({
const theme = SettingsStore.getValue("theme"); const theme = SettingsStore.getValue("theme");
if (theme !== "status") { if (theme !== "status") {
header = <h2>{ _t('Sign in') }</h2>; header = <h2>{ _t('Sign in') }</h2>;
} } else {
else {
if (!this.state.errorText) { if (!this.state.errorText) {
header = <h2>{ _t('Sign in to get started') }</h2>; header = <h2>{ _t('Sign in to get started') }</h2>;
} }

View file

@ -399,8 +399,7 @@ module.exports = React.createClass({
// FIXME: remove hardcoded Status team tweaks at some point // FIXME: remove hardcoded Status team tweaks at some point
if (theme === 'status' && this.state.errorText) { if (theme === 'status' && this.state.errorText) {
header = <div className="mx_Login_error">{ this.state.errorText }</div>; header = <div className="mx_Login_error">{ this.state.errorText }</div>;
} } else {
else {
header = <h2>{ _t('Create an account') }</h2>; header = <h2>{ _t('Create an account') }</h2>;
if (this.state.errorText) { if (this.state.errorText) {
errorText = <div className="mx_Login_error">{ this.state.errorText }</div>; errorText = <div className="mx_Login_error">{ this.state.errorText }</div>;

View file

@ -54,7 +54,7 @@ export default React.createClass({
const deviceInfo = r[userId][deviceId]; const deviceInfo = r[userId][deviceId];
if(!deviceInfo) { if (!deviceInfo) {
console.warn(`No details found for device ${userId}:${deviceId}`); console.warn(`No details found for device ${userId}:${deviceId}`);
this.props.onFinished(false); this.props.onFinished(false);

View file

@ -19,9 +19,9 @@ export default class AppPermission extends React.Component {
const searchParams = new URLSearchParams(wurl.search); 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')); curl = url.parse(searchParams.get('url'));
if(curl) { if (curl) {
curl.search = curl.query = ""; curl.search = curl.query = "";
curlString = curl.format(); curlString = curl.format();
} }
@ -34,7 +34,7 @@ export default class AppPermission extends React.Component {
} }
isScalarWurl(wurl) { isScalarWurl(wurl) {
if(wurl && wurl.hostname && ( if (wurl && wurl.hostname && (
wurl.hostname === 'scalar.vector.im' || wurl.hostname === 'scalar.vector.im' ||
wurl.hostname === 'scalar-staging.riot.im' || wurl.hostname === 'scalar-staging.riot.im' ||
wurl.hostname === 'scalar-develop.riot.im' || wurl.hostname === 'scalar-develop.riot.im' ||

View file

@ -284,7 +284,7 @@ export default React.createClass({
formatAppTileName() { formatAppTileName() {
let appTileName = "No name"; 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(); appTileName = this.props.name.trim();
} }
return appTileName; return appTileName;
@ -374,7 +374,7 @@ export default React.createClass({
const deleteWidgetLabel = this._deleteWidgetLabel(); const deleteWidgetLabel = this._deleteWidgetLabel();
let deleteIcon = 'img/cancel_green.svg'; let deleteIcon = 'img/cancel_green.svg';
let deleteClasses = 'mx_AppTileMenuBarWidget'; let deleteClasses = 'mx_AppTileMenuBarWidget';
if(this._canUserModify()) { if (this._canUserModify()) {
deleteIcon = 'img/icon-delete-pink.svg'; deleteIcon = 'img/icon-delete-pink.svg';
deleteClasses += ' mx_AppTileMenuBarWidgetDelete'; deleteClasses += ' mx_AppTileMenuBarWidgetDelete';
} }

View file

@ -41,8 +41,8 @@ export default class LanguageDropdown extends React.Component {
componentWillMount() { componentWillMount() {
languageHandler.getAllLanguagesFromJson().then((langs) => { languageHandler.getAllLanguagesFromJson().then((langs) => {
langs.sort(function(a, b) { 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; return 0;
}); });
this.setState({langs}); this.setState({langs});
@ -57,7 +57,7 @@ export default class LanguageDropdown extends React.Component {
const language = SettingsStore.getValue("language", null, /*excludeDefault:*/true); const language = SettingsStore.getValue("language", null, /*excludeDefault:*/true);
if (language) { if (language) {
this.props.onOptionChange(language); this.props.onOptionChange(language);
}else { } else {
const language = languageHandler.normalizeLanguageKey(languageHandler.getLanguageFromBrowser()); const language = languageHandler.normalizeLanguageKey(languageHandler.getLanguageFromBrowser());
this.props.onOptionChange(language); this.props.onOptionChange(language);
} }

View file

@ -216,7 +216,7 @@ module.exports = React.createClass({
// are there only to show translators to non-English languages // are there only to show translators to non-English languages
// that the verb is conjugated to plural or singular Subject. // that the verb is conjugated to plural or singular Subject.
let res = null; let res = null;
switch(t) { switch (t) {
case "joined": case "joined":
res = (userCount > 1) res = (userCount > 1)
? _t("%(severalUsers)sjoined %(count)s times", { severalUsers: "", count: repeats }) ? _t("%(severalUsers)sjoined %(count)s times", { severalUsers: "", count: repeats })
@ -304,7 +304,7 @@ module.exports = React.createClass({
return items[0]; return items[0];
} else if (remaining > 0) { } else if (remaining > 0) {
items = items.slice(0, itemLimit); 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 { } else {
const lastItem = items.pop(); const lastItem = items.pop();
return _t("%(items)s and %(lastItem)s", { items: items.join(', '), lastItem: lastItem }); return _t("%(items)s and %(lastItem)s", { items: items.join(', '), lastItem: lastItem });

View file

@ -122,7 +122,7 @@ class PasswordLogin extends React.Component {
mx_Login_field_disabled: disabled, mx_Login_field_disabled: disabled,
}; };
switch(loginType) { switch (loginType) {
case PasswordLogin.LOGIN_FIELD_EMAIL: case PasswordLogin.LOGIN_FIELD_EMAIL:
classes.mx_Login_email = true; classes.mx_Login_email = true;
return <input return <input
@ -144,9 +144,9 @@ class PasswordLogin extends React.Component {
type="text" type="text"
name="username" // make it a little easier for browser's remember-password name="username" // make it a little easier for browser's remember-password
onChange={this.onUsernameChanged} onChange={this.onUsernameChanged}
placeholder={ SdkConfig.get().disable_custom_urls ? placeholder={SdkConfig.get().disable_custom_urls ?
_t("Username on %(hs)s", { _t("Username on %(hs)s", {
hs: this.props.hsUrl.replace(/^https?:\/\//, '') hs: this.props.hsUrl.replace(/^https?:\/\//, ''),
}) : _t("User name")} }) : _t("User name")}
value={this.state.username} value={this.state.username}
autoFocus autoFocus

View file

@ -282,7 +282,7 @@ module.exports = React.createClass({
const emailSection = ( const emailSection = (
<div> <div>
<input type="text" ref="email" <input type="text" ref="email"
autoFocus={true} placeholder={ emailPlaceholder } autoFocus={true} placeholder={emailPlaceholder}
defaultValue={this.props.defaultEmail} defaultValue={this.props.defaultEmail}
className={this._classForField(FIELD_EMAIL, 'mx_Login_field')} className={this._classForField(FIELD_EMAIL, 'mx_Login_field')}
onBlur={function() {self.validateField(FIELD_EMAIL);}} onBlur={function() {self.validateField(FIELD_EMAIL);}}

View file

@ -43,7 +43,7 @@ export default function SenderProfile(props) {
]; ];
let content; let content;
if(props.text) { if (props.text) {
content = _t(props.text, { senderName: () => nameElem }); content = _t(props.text, { senderName: () => nameElem });
} else { } else {
// There is nothing to translate here, so call substitute() instead // There is nothing to translate here, so call substitute() instead

View file

@ -133,7 +133,7 @@ module.exports = React.createClass({
'$matrix_avatar_url': user ? MatrixClientPeg.get().mxcUrlToHttp(user.avatarUrl) : '', '$matrix_avatar_url': user ? MatrixClientPeg.get().mxcUrlToHttp(user.avatarUrl) : '',
}; };
if(app.data) { if (app.data) {
Object.keys(app.data).forEach((key) => { Object.keys(app.data).forEach((key) => {
params['$' + key] = app.data[key]; params['$' + key] = app.data[key];
}); });
@ -177,7 +177,7 @@ module.exports = React.createClass({
_canUserModify: function() { _canUserModify: function() {
try { try {
return WidgetUtils.canUserModifyWidgets(this.props.room.roomId); return WidgetUtils.canUserModifyWidgets(this.props.room.roomId);
} catch(err) { } catch (err) {
console.error(err); console.error(err);
return false; return false;
} }

View file

@ -562,7 +562,7 @@ module.exports = withMatrixClient(React.createClass({
onMemberAvatarClick: function() { onMemberAvatarClick: function() {
const member = this.props.member; const member = this.props.member;
const avatarUrl = member.user ? member.user.avatarUrl : member.events.member.getContent().avatar_url; 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 httpUrl = this.props.matrixClient.mxcUrlToHttp(avatarUrl);
const ImageView = sdk.getComponent("elements.ImageView"); const ImageView = sdk.getComponent("elements.ImageView");

View file

@ -111,10 +111,10 @@ export default class MessageComposer extends React.Component {
</div> </div>
), ),
onFinished: (shouldUpload) => { onFinished: (shouldUpload) => {
if(shouldUpload) { if (shouldUpload) {
// MessageComposer shouldn't have to rely on its parent passing in a callback to upload a file // MessageComposer shouldn't have to rely on its parent passing in a callback to upload a file
if (files) { if (files) {
for(let i=0; i<files.length; i++) { for (let i=0; i<files.length; i++) {
this.props.uploadFile(files[i]); this.props.uploadFile(files[i]);
} }
} }

View file

@ -434,7 +434,7 @@ export default class MessageComposerInput extends React.Component {
if (SettingsStore.getValue('MessageComposerInput.autoReplaceEmoji')) { if (SettingsStore.getValue('MessageComposerInput.autoReplaceEmoji')) {
// The first matched group includes just the matched plaintext emoji // The first matched group includes just the matched plaintext emoji
const emojiMatch = REGEX_EMOJI_WHITESPACE.exec(text.slice(0, currentStartOffset)); const emojiMatch = REGEX_EMOJI_WHITESPACE.exec(text.slice(0, currentStartOffset));
if(emojiMatch) { if (emojiMatch) {
// plaintext -> hex unicode // plaintext -> hex unicode
const emojiUc = asciiList[emojiMatch[1]]; const emojiUc = asciiList[emojiMatch[1]];
// hex unicode -> shortname -> actual unicode // hex unicode -> shortname -> actual unicode
@ -696,7 +696,7 @@ export default class MessageComposerInput extends React.Component {
} }
const currentBlockType = RichUtils.getCurrentBlockType(this.state.editorState); const currentBlockType = RichUtils.getCurrentBlockType(this.state.editorState);
if( if (
['code-block', 'blockquote', 'unordered-list-item', 'ordered-list-item'] ['code-block', 'blockquote', 'unordered-list-item', 'ordered-list-item']
.includes(currentBlockType) .includes(currentBlockType)
) { ) {

View file

@ -389,7 +389,7 @@ module.exports = React.createClass({
let rightRow; let rightRow;
let manageIntegsButton; 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 = <ManageIntegsButton manageIntegsButton = <ManageIntegsButton
roomId={this.props.room.roomId} roomId={this.props.room.roomId}
/>; />;

View file

@ -165,13 +165,13 @@ module.exports = React.createClass({
let actionText; let actionText;
if (kicked) { if (kicked) {
if(roomName) { if (roomName) {
actionText = _t("You have been kicked from %(roomName)s by %(userName)s.", {roomName: roomName, userName: kickerName}); actionText = _t("You have been kicked from %(roomName)s by %(userName)s.", {roomName: roomName, userName: kickerName});
} else { } else {
actionText = _t("You have been kicked from this room by %(userName)s.", {userName: kickerName}); actionText = _t("You have been kicked from this room by %(userName)s.", {userName: kickerName});
} }
} else if (banned) { } else if (banned) {
if(roomName) { if (roomName) {
actionText = _t("You have been banned from %(roomName)s by %(userName)s.", {roomName: roomName, userName: kickerName}); actionText = _t("You have been banned from %(roomName)s by %(userName)s.", {roomName: roomName, userName: kickerName});
} else { } else {
actionText = _t("You have been banned from this room by %(userName)s.", {userName: kickerName}); actionText = _t("You have been banned from this room by %(userName)s.", {userName: kickerName});

View file

@ -309,9 +309,9 @@ module.exports = React.createClass({
} }
// url preview settings // url preview settings
let ps = this.saveUrlPreviewSettings(); const ps = this.saveUrlPreviewSettings();
if (ps.length > 0) { if (ps.length > 0) {
ps.map(p => promises.push(p)); ps.map((p) => promises.push(p));
} }
// related groups // related groups
@ -584,7 +584,7 @@ module.exports = React.createClass({
const roomState = this.props.room.currentState; const roomState = this.props.room.currentState;
const isEncrypted = cli.isRoomEncrypted(this.props.room.roomId); const isEncrypted = cli.isRoomEncrypted(this.props.room.roomId);
let settings = ( const settings = (
<SettingsFlag name="blacklistUnverifiedDevices" <SettingsFlag name="blacklistUnverifiedDevices"
level={SettingLevel.ROOM_DEVICE} level={SettingLevel.ROOM_DEVICE}
roomId={this.props.room.roomId} roomId={this.props.room.roomId}
@ -747,7 +747,7 @@ module.exports = React.createClass({
} }
}); });
var tagsSection = null; let tagsSection = null;
if (canSetTag || self.state.tags) { if (canSetTag || self.state.tags) {
tagsSection = tagsSection =
<div className="mx_RoomSettings_tags"> <div className="mx_RoomSettings_tags">

View file

@ -54,7 +54,7 @@ module.exports = React.createClass({
}, },
getInitialState: function() { getInitialState: function() {
return({ return ({
hover: false, hover: false,
badgeHover: false, badgeHover: false,
menuDisplayed: false, menuDisplayed: false,

View file

@ -39,7 +39,7 @@ module.exports = React.createClass({
}, },
onResize: function(e) { onResize: function(e) {
if(this.props.onResize) { if (this.props.onResize) {
this.props.onResize(e); this.props.onResize(e);
} }
}, },

View file

@ -116,7 +116,7 @@ export async function decryptMegolmKeyFile(data, password) {
aesKey, aesKey,
ciphertext, ciphertext,
); );
} catch(e) { } catch (e) {
throw friendlyError('subtleCrypto.decrypt failed: ' + e, cryptoFailMsg()); throw friendlyError('subtleCrypto.decrypt failed: ' + e, cryptoFailMsg());
} }

View file

@ -23,7 +23,7 @@ const localStorage = window.localStorage;
let indexedDB; let indexedDB;
try { try {
indexedDB = window.indexedDB; indexedDB = window.indexedDB;
} catch(e) {} } catch (e) {}
/** /**
* Create a new matrix client, with the persistent stores set up appropriately * Create a new matrix client, with the persistent stores set up appropriately