diff --git a/src/Lifecycle.js b/src/Lifecycle.js index 59580e7cb6..424c58249c 100644 --- a/src/Lifecycle.js +++ b/src/Lifecycle.js @@ -156,7 +156,7 @@ export function attemptTokenLogin(queryParams, defaultDeviceDisplayName) { } function _registerAsGuest(hsUrl, isUrl, defaultDeviceDisplayName) { - console.log("Doing guest login on %s", hsUrl); + console.log(`Doing guest login on ${hsUrl}`); // TODO: we should probably de-duplicate this and Login.loginAsGuest. // Not really sure where the right home for it is. @@ -171,7 +171,7 @@ function _registerAsGuest(hsUrl, isUrl, defaultDeviceDisplayName) { initial_device_display_name: defaultDeviceDisplayName, }, }).then((creds) => { - console.log("Registered as guest: %s", creds.user_id); + console.log(`Registered as guest: ${creds.user_id}`); return _doSetLoggedIn({ userId: creds.user_id, deviceId: creds.device_id, @@ -215,7 +215,7 @@ function _restoreFromLocalStorage() { } if (accessToken && userId && hsUrl) { - console.log("Restoring session for %s", userId); + console.log(`Restoring session for ${userId}`); try { return _doSetLoggedIn({ userId: userId, @@ -315,10 +315,10 @@ async function _doSetLoggedIn(credentials, clearStorage) { credentials.guest = Boolean(credentials.guest); console.log( - "setLoggedIn: mxid:", credentials.userId, - "deviceId:", credentials.deviceId, - "guest:", credentials.guest, - "hs:", credentials.homeserverUrl, + "setLoggedIn: mxid: " + credentials.userId + + " deviceId: " + credentials.deviceId + + " guest: " + credentials.guest + + " hs: " + credentials.homeserverUrl, ); // This is dispatched to indicate that the user is still in the process of logging in @@ -395,7 +395,7 @@ function _persistCredentialsToLocalStorage(credentials) { localStorage.setItem("mx_device_id", credentials.deviceId); } - console.log("Session persisted for %s", credentials.userId); + console.log(`Session persisted for ${credentials.userId}`); } /** diff --git a/src/MatrixClientPeg.js b/src/MatrixClientPeg.js index 47370e2142..03716be2da 100644 --- a/src/MatrixClientPeg.js +++ b/src/MatrixClientPeg.js @@ -84,7 +84,9 @@ class MatrixClientPeg { let promise = this.matrixClient.store.startup(); // log any errors when starting up the database (if one exists) - promise.catch((err) => { console.error(err); }); + promise.catch((err) => { + console.error(`Error starting matrixclient store: ${err}`); + }); // regardless of errors, start the client. If we did error out, we'll // just end up doing a full initial /sync. diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 17df3172df..2bb9476701 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -330,7 +330,7 @@ module.exports = React.createClass({ defaultDeviceDisplayName: this.props.defaultDeviceDisplayName, }); }).catch((e) => { - console.error("Unable to load session", e); + console.error(`Error attempting to load session from token params: ${e}`); return false; }).then((loadedSession) => { if (!loadedSession) { diff --git a/src/components/views/dialogs/ChatInviteDialog.js b/src/components/views/dialogs/ChatInviteDialog.js index 9a14cb91d3..a85efadef7 100644 --- a/src/components/views/dialogs/ChatInviteDialog.js +++ b/src/components/views/dialogs/ChatInviteDialog.js @@ -178,7 +178,7 @@ module.exports = React.createClass({ }, onQueryChanged: function(ev) { - const query = ev.target.value.toLowerCase(); + const query = ev.target.value; if (this.queryChangedDebouncer) { clearTimeout(this.queryChangedDebouncer); } @@ -271,10 +271,11 @@ module.exports = React.createClass({ query, searchError: null, }); + const queryLowercase = query.toLowerCase(); const results = []; MatrixClientPeg.get().getUsers().forEach((user) => { - if (user.userId.toLowerCase().indexOf(query) === -1 && - user.displayName.toLowerCase().indexOf(query) === -1 + if (user.userId.toLowerCase().indexOf(queryLowercase) === -1 && + user.displayName.toLowerCase().indexOf(queryLowercase) === -1 ) { return; }