From 765800c09b603353d0e72ed663ac213eeefa3f96 Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Thu, 14 Apr 2022 18:35:18 -0400 Subject: [PATCH] Fix code review nits --- src/events/EventTileFactory.tsx | 5 +++-- src/utils/EventUtils.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/events/EventTileFactory.tsx b/src/events/EventTileFactory.tsx index 931745faf76..7beda8cc305 100644 --- a/src/events/EventTileFactory.tsx +++ b/src/events/EventTileFactory.tsx @@ -159,8 +159,9 @@ export function pickFactory( return JSONEventFactory; } - const noEventFactoryFactory: (() => Optional) = () => showHiddenEvents ? - JSONEventFactory : undefined; // just don't render things that we shouldn't render + const noEventFactoryFactory: (() => Optional) = () => showHiddenEvents + ? JSONEventFactory + : undefined; // just don't render things that we shouldn't render // We run all the event type checks first as they might override the factory entirely. diff --git a/src/utils/EventUtils.ts b/src/utils/EventUtils.ts index 707c3b8df2e..4b626397f93 100644 --- a/src/utils/EventUtils.ts +++ b/src/utils/EventUtils.ts @@ -153,9 +153,9 @@ export enum MessageModerationState { // This is lazily initialized and cached since getMessageModerationState needs it, // and is called on timeline rendering hot-paths -let msc3531Enabled: boolean; +let msc3531Enabled: boolean | null = null; const getMsc3531Enabled = (): boolean => { - if (msc3531Enabled == null) { + if (msc3531Enabled === null) { msc3531Enabled = SettingsStore.getValue("feature_msc3531_hide_messages_pending_moderation"); } return msc3531Enabled;