Appease the linter

Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
Travis Ralston 2017-11-05 15:37:06 -07:00
parent 10519f9465
commit 781b94c8f4
9 changed files with 14 additions and 13 deletions

View file

@ -1118,7 +1118,7 @@ module.exports = React.createClass({
if (cli.isCryptoEnabled()) { if (cli.isCryptoEnabled()) {
const blacklistEnabled = SettingsStore.getValueAt( const blacklistEnabled = SettingsStore.getValueAt(
SettingLevel.DEVICE, SettingLevel.DEVICE,
"blacklistUnverifiedDevices" "blacklistUnverifiedDevices",
); );
cli.setGlobalBlacklistUnverifiedDevices(blacklistEnabled); cli.setGlobalBlacklistUnverifiedDevices(blacklistEnabled);
} }

View file

@ -18,7 +18,6 @@ limitations under the License.
import React from 'react'; import React from 'react';
import sdk from '../../../index'; import sdk from '../../../index';
import UserSettingsStore from '../../../UserSettingsStore';
import * as languageHandler from '../../../languageHandler'; import * as languageHandler from '../../../languageHandler';
import SettingsStore from "../../../settings/SettingsStore"; import SettingsStore from "../../../settings/SettingsStore";

View file

@ -59,7 +59,7 @@ module.exports = React.createClass({
this.props.name, this.props.name,
this.props.roomId, this.props.roomId,
this.props.level, this.props.level,
val !== undefined ? val : this.state.value val !== undefined ? val : this.state.value,
); );
}, },

View file

@ -185,7 +185,7 @@ export const SETTINGS = {
}, },
"language": { "language": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG, supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
default: "en" default: "en",
}, },
"analyticsOptOut": { "analyticsOptOut": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG, supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
@ -240,4 +240,4 @@ export const SETTINGS = {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS, supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: false, default: false,
}, },
}; };

View file

@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import Promise from 'bluebird';
import DeviceSettingsHandler from "./handlers/DeviceSettingsHandler"; import DeviceSettingsHandler from "./handlers/DeviceSettingsHandler";
import RoomDeviceSettingsHandler from "./handlers/RoomDeviceSettingsHandler"; import RoomDeviceSettingsHandler from "./handlers/RoomDeviceSettingsHandler";
import DefaultSettingsHandler from "./handlers/DefaultSettingsHandler"; import DefaultSettingsHandler from "./handlers/DefaultSettingsHandler";
@ -210,14 +209,14 @@ export default class SettingsStore {
const handlers = SettingsStore._getHandlers(settingName); const handlers = SettingsStore._getHandlers(settingName);
if (explicit) { if (explicit) {
let handler = handlers[level]; const handler = handlers[level];
if (!handler) return SettingsStore._tryControllerOverride(settingName, level, roomId, null); if (!handler) return SettingsStore._tryControllerOverride(settingName, level, roomId, null);
const value = handler.getValue(settingName, roomId); const value = handler.getValue(settingName, roomId);
return SettingsStore._tryControllerOverride(settingName, level, roomId, value); return SettingsStore._tryControllerOverride(settingName, level, roomId, value);
} }
for (let i = minIndex; i < LEVEL_ORDER.length; i++) { for (let i = minIndex; i < LEVEL_ORDER.length; i++) {
let handler = handlers[LEVEL_ORDER[i]]; const handler = handlers[LEVEL_ORDER[i]];
if (!handler) continue; if (!handler) continue;
if (excludeDefault && LEVEL_ORDER[i] === "default") continue; if (excludeDefault && LEVEL_ORDER[i] === "default") continue;

View file

@ -46,4 +46,4 @@ export default class SettingController {
onChange(level, roomId, newValue) { onChange(level, roomId, newValue) {
// do nothing by default // do nothing by default
} }
} }

View file

@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import Promise from 'bluebird';
import SettingsHandler from "./SettingsHandler"; import SettingsHandler from "./SettingsHandler";
import SdkConfig from "../../SdkConfig"; import SdkConfig from "../../SdkConfig";

View file

@ -66,4 +66,4 @@ export default class LocalEchoWrapper extends SettingsHandler {
isSupported() { isSupported() {
return this._handler.isSupported(); return this._handler.isSupported();
} }
} }

View file

@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import Promise from "bluebird";
/** /**
* Represents the base class for all level handlers. This class performs no logic * Represents the base class for all level handlers. This class performs no logic
* and should be overridden. * and should be overridden.
@ -28,7 +30,8 @@ export default class SettingsHandler {
* @returns {*} The setting value, or null if not found. * @returns {*} The setting value, or null if not found.
*/ */
getValue(settingName, roomId) { getValue(settingName, roomId) {
throw new Error("Operation not possible: getValue was not overridden"); console.error("Invalid operation: getValue was not overridden");
return null;
} }
/** /**
@ -43,7 +46,8 @@ export default class SettingsHandler {
* @returns {Promise} Resolves when the setting has been saved. * @returns {Promise} Resolves when the setting has been saved.
*/ */
setValue(settingName, roomId, newValue) { setValue(settingName, roomId, newValue) {
throw new Error("Operation not possible: setValue was not overridden"); console.error("Invalid operation: setValue was not overridden");
return Promise.reject();
} }
/** /**