Appease the linter

pull/21833/head
Travis Ralston 2021-07-13 00:02:44 -06:00
parent ff7a18da56
commit 4444ccb079
2 changed files with 8 additions and 7 deletions

View File

@ -36,7 +36,7 @@ export default class Spinner extends React.PureComponent<IProps> {
{ message && <React.Fragment><div className="mx_Spinner_Msg">{ message }</div>&nbsp;</React.Fragment> } { message && <React.Fragment><div className="mx_Spinner_Msg">{ message }</div>&nbsp;</React.Fragment> }
<div <div
className="mx_Spinner_icon" className="mx_Spinner_icon"
style={{width: w, height: h}} style={{ width: w, height: h }}
aria-label={_t("Loading...")} aria-label={_t("Loading...")}
/> />
</div> </div>

View File

@ -17,7 +17,7 @@ limitations under the License.
import React from "react"; import React from "react";
import Spinner from "../elements/Spinner"; import Spinner from "../elements/Spinner";
import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { MatrixClientPeg } from "../../../MatrixClientPeg";
import { IAnnotatedPushRule, IPusher, PushRuleKind, RuleId, } from "matrix-js-sdk/src/@types/PushRules"; import { IAnnotatedPushRule, IPusher, PushRuleKind, RuleId } from "matrix-js-sdk/src/@types/PushRules";
import { import {
ContentRules, ContentRules,
IContentRules, IContentRules,
@ -80,7 +80,7 @@ const RULE_DISPLAY_ORDER: string[] = [
RuleId.IncomingCall, RuleId.IncomingCall,
RuleId.SuppressNotices, RuleId.SuppressNotices,
RuleId.Tombstone, RuleId.Tombstone,
] ];
interface IVectorPushRule { interface IVectorPushRule {
ruleId: RuleId | typeof KEYWORD_RULE_ID | string; ruleId: RuleId | typeof KEYWORD_RULE_ID | string;
@ -181,7 +181,7 @@ export default class Notifications extends React.PureComponent<IProps, IState> {
// noinspection JSUnfilteredForInLoop // noinspection JSUnfilteredForInLoop
const kind = k as PushRuleKind; const kind = k as PushRuleKind;
for (const r of ruleSets.global[kind]) { for (const r of ruleSets.global[kind]) {
const rule: IAnnotatedPushRule = Object.assign(r, {kind}); const rule: IAnnotatedPushRule = Object.assign(r, { kind });
const category = categories[rule.rule_id] ?? RuleClass.Other; const category = categories[rule.rule_id] ?? RuleClass.Other;
if (rule.rule_id[0] === '.') { if (rule.rule_id[0] === '.') {
@ -356,11 +356,12 @@ export default class Notifications extends React.PureComponent<IProps, IState> {
} else { } else {
const definition = VectorPushRulesDefinitions[rule.ruleId]; const definition = VectorPushRulesDefinitions[rule.ruleId];
const actions = definition.vectorStateToActions[checkedState]; const actions = definition.vectorStateToActions[checkedState];
const cli = MatrixClientPeg.get();
if (!actions) { if (!actions) {
await MatrixClientPeg.get().setPushRuleEnabled('global', rule.rule.kind, rule.rule.rule_id, false); await cli.setPushRuleEnabled('global', rule.rule.kind, rule.rule.rule_id, false);
} else { } else {
await MatrixClientPeg.get().setPushRuleActions('global', rule.rule.kind, rule.rule.rule_id, actions); await cli.setPushRuleActions('global', rule.rule.kind, rule.rule.rule_id, actions);
await MatrixClientPeg.get().setPushRuleEnabled('global', rule.rule.kind, rule.rule.rule_id, true); await cli.setPushRuleEnabled('global', rule.rule.kind, rule.rule.rule_id, true);
} }
} }