From d94f1151b1dc0503deec6890d18e98287fdf7000 Mon Sep 17 00:00:00 2001 From: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com> Date: Fri, 10 Sep 2021 17:50:56 -0500 Subject: [PATCH] Respect "rules of hooks" in `` --- ts/state/smart/CustomizingPreferredReactionsModal.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ts/state/smart/CustomizingPreferredReactionsModal.tsx b/ts/state/smart/CustomizingPreferredReactionsModal.tsx index 2c5c16851ed..f5ecbdfc284 100644 --- a/ts/state/smart/CustomizingPreferredReactionsModal.tsx +++ b/ts/state/smart/CustomizingPreferredReactionsModal.tsx @@ -25,11 +25,6 @@ export function SmartCustomizingPreferredReactionsModal(): JSX.Element { StateType, ReturnType >(state => getCustomizeModalState(state)); - if (!customizeModalState) { - throw new Error( - ' requires a modal' - ); - } const recentEmojis = useRecentEmojis(); @@ -37,6 +32,12 @@ export function SmartCustomizingPreferredReactionsModal(): JSX.Element { getEmojiSkinTone(state) ); + if (!customizeModalState) { + throw new Error( + ' requires a modal' + ); + } + return (