diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index ec959a5c61..fc1257922a 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1096,12 +1096,14 @@ module.exports = React.createClass({ krh.handleKeyRequestCancellation(req); }); cli.on("Room", (room) => { - const blacklistEnabled = SettingsStore.getValueAt( - SettingLevel.ROOM_DEVICE, - "blacklistUnverifiedDevices", - room.roomId, - ); - room.setBlacklistUnverifiedDevices(blacklistEnabled); + if (MatrixClientPeg.get().isCryptoEnabled()) { + const blacklistEnabled = SettingsStore.getValueAt( + SettingLevel.ROOM_DEVICE, + "blacklistUnverifiedDevices", + room.roomId, + ); + room.setBlacklistUnverifiedDevices(blacklistEnabled); + } }); }, @@ -1113,11 +1115,13 @@ module.exports = React.createClass({ _onClientStarted: function() { const cli = MatrixClientPeg.get(); - const blacklistEnabled = SettingsStore.getValueAt( - SettingLevel.DEVICE, - "blacklistUnverifiedDevices" - ); - cli.setGlobalBlacklistUnverifiedDevices(blacklistEnabled); + if (cli.isCryptoEnabled()) { + const blacklistEnabled = SettingsStore.getValueAt( + SettingLevel.DEVICE, + "blacklistUnverifiedDevices" + ); + cli.setGlobalBlacklistUnverifiedDevices(blacklistEnabled); + } }, showScreen: function(screen, params) { diff --git a/src/settings/handlers/LocalEchoWrapper.js b/src/settings/handlers/LocalEchoWrapper.js index 8cc8e0294d..e9a17d7698 100644 --- a/src/settings/handlers/LocalEchoWrapper.js +++ b/src/settings/handlers/LocalEchoWrapper.js @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +import Promise from "bluebird"; import SettingsHandler from "./SettingsHandler"; /** @@ -51,7 +52,8 @@ export default class LocalEchoWrapper extends SettingsHandler { const cacheRoomId = roomId ? roomId : "UNDEFINED"; // avoid weird keys bySetting[cacheRoomId] = newValue; - return this._handler.setValue(settingName, roomId, newValue).finally(() => { + const handlerPromise = this._handler.setValue(settingName, roomId, newValue); + return Promise.resolve(handlerPromise).finally(() => { delete bySetting[cacheRoomId]; }); } diff --git a/test/components/structures/MessagePanel-test.js b/test/components/structures/MessagePanel-test.js index 82b1cdab6c..e7176e2c16 100644 --- a/test/components/structures/MessagePanel-test.js +++ b/test/components/structures/MessagePanel-test.js @@ -62,7 +62,6 @@ describe('MessagePanel', function() { client.credentials = {userId: '@me:here'}; // HACK: We assume all settings want to be disabled - // TODO: {Travis} Run the tests to verify this works SettingsStore.getValue = sinon.stub().returns(false); });