Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Apply strictNullChecks to src/components/views/settings #10724

Merged
merged 26 commits into from
May 5, 2023

Conversation

kerryarchibald
Copy link
Contributor

@kerryarchibald kerryarchibald commented Apr 27, 2023

Fixes element-hq/element-web#25217
Fixes element-hq/element-web#25017
For element-hq/element-web#21967

Checklist

  • Tests written for new code (and old code if feasible)
  • Linter and other CI checks pass
  • Sign-off given on the changes (see CONTRIBUTING.md)

This change is marked as an internal change (Task), so will not be included in the changelog.

@kerryarchibald kerryarchibald added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Apr 27, 2023
Copy link
Contributor

@florianduros florianduros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good ! Two minor comments :)

@@ -316,7 +319,7 @@ export default class Notifications extends React.PureComponent<IProps, IState> {
// noinspection JSUnfilteredForInLoop
const kind = k as PushRuleKind;

for (const r of ruleSets.global[kind]) {
for (const r of ruleSets.global[kind]!) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add an explanation why we are sure that ruleSets.global[kind] is defined

@@ -344,7 +347,7 @@ export default class Notifications extends React.PureComponent<IProps, IState> {
preparedNewState.vectorPushRules[category] = [];
for (const rule of defaultRules[category]) {
const definition: VectorPushRuleDefinition = VectorPushRulesDefinitions[rule.rule_id];
const vectorState = definition.ruleToVectorState(rule);
const vectorState = definition.ruleToVectorState(rule)!;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add an explanation why we are sure that vectorState is defined

@t3chguy t3chguy disabled auto-merge May 5, 2023 08:13
@t3chguy t3chguy merged commit 1f4d857 into develop May 5, 2023
@t3chguy t3chguy deleted the kerry/25217/snc-views-settings branch May 5, 2023 08:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
3 participants