Fix various TypeScript linting issues

pull/21833/head
Travis Ralston 2020-07-29 11:03:43 -06:00
parent 9d124ff09b
commit 9c8682428f
4 changed files with 9 additions and 8 deletions

View File

@ -256,7 +256,7 @@ class _MatrixClientPeg implements IMatrixClientPeg {
deviceId: creds.deviceId, deviceId: creds.deviceId,
pickleKey: creds.pickleKey, pickleKey: creds.pickleKey,
timelineSupport: true, timelineSupport: true,
forceTURN: !SettingsStore.getValue('webRtcAllowPeerToPeer', false), forceTURN: !SettingsStore.getValue('webRtcAllowPeerToPeer'),
fallbackICEServerAllowed: !!SettingsStore.getValue('fallbackICEServerAllowed'), fallbackICEServerAllowed: !!SettingsStore.getValue('fallbackICEServerAllowed'),
verificationMethods: [ verificationMethods: [
verificationMethods.SAS, verificationMethods.SAS,

View File

@ -20,11 +20,12 @@ import SettingsStore from "../../../settings/SettingsStore";
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
import ToggleSwitch from "./ToggleSwitch"; import ToggleSwitch from "./ToggleSwitch";
import StyledCheckbox from "./StyledCheckbox"; import StyledCheckbox from "./StyledCheckbox";
import { SettingLevel } from "../../../settings/SettingLevel";
interface IProps { interface IProps {
// The setting must be a boolean // The setting must be a boolean
name: string; name: string;
level: string; level: SettingLevel;
roomId?: string; // for per-room settings roomId?: string; // for per-room settings
label?: string; // untranslated label?: string; // untranslated
isExplicit?: boolean; isExplicit?: boolean;
@ -52,8 +53,8 @@ export default class SettingsFlag extends React.Component<IProps, IState> {
}; };
} }
private onChange = (checked: boolean): void => { private onChange = async (checked: boolean) => {
this.save(checked); await this.save(checked);
this.setState({ value: checked }); this.setState({ value: checked });
if (this.props.onChange) this.props.onChange(checked); if (this.props.onChange) this.props.onChange(checked);
}; };
@ -62,8 +63,8 @@ export default class SettingsFlag extends React.Component<IProps, IState> {
this.onChange(e.target.checked); this.onChange(e.target.checked);
}; };
private save = (val?: boolean): void => { private save = async (val?: boolean) => {
return SettingsStore.setValue( await SettingsStore.setValue(
this.props.name, this.props.name,
this.props.roomId, this.props.roomId,
this.props.level, this.props.level,

View File

@ -141,7 +141,7 @@ export default async function sendBugReport(bugReportEndpoint: string, opts: IOp
} }
// add labs options // add labs options
const enabledLabs = SettingsStore.getLabsFeatures().filter(SettingsStore.isFeatureEnabled); const enabledLabs = SettingsStore.getLabsFeatures().filter(f => SettingsStore.isFeatureEnabled(f));
if (enabledLabs.length) { if (enabledLabs.length) {
body.append('enabled_labs', enabledLabs.join(', ')); body.append('enabled_labs', enabledLabs.join(', '));
} }

View File

@ -291,7 +291,7 @@ export default class SettingsStore {
throw new Error("Setting " + settingName + " is not a feature"); throw new Error("Setting " + settingName + " is not a feature");
} }
return SettingsStore.setValue(settingName, null, "device", value); return SettingsStore.setValue(settingName, null, SettingLevel.DEVICE, value);
} }
/** /**