From 0b5dab3ddf155d200f33890e52bb61280fac5b23 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Wed, 21 Dec 2022 13:15:30 -0300 Subject: [PATCH] [FIX] Notification preferences menu shows nothing (#4703) --- app/views/UserNotificationPreferencesView/index.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/UserNotificationPreferencesView/index.tsx b/app/views/UserNotificationPreferencesView/index.tsx index eca0d91a5..f624f5d92 100644 --- a/app/views/UserNotificationPreferencesView/index.tsx +++ b/app/views/UserNotificationPreferencesView/index.tsx @@ -17,7 +17,7 @@ import log from '../../lib/methods/helpers/log'; const UserNotificationPreferencesView = () => { const [preferences, setPreferences] = useState({} as INotificationPreferences); - const [loading, setLoading] = useState(false); + const [loading, setLoading] = useState(true); const navigation = useNavigation>(); const userId = useAppSelector(state => getUserSelector(state).id); @@ -33,10 +33,11 @@ const UserNotificationPreferencesView = () => { try { const result = await Services.getUserPreferences(userId); if (result.success) { - setLoading(true); + setLoading(false); setPreferences(result.preferences); } } catch (error) { + setLoading(false); log(error); } } @@ -63,6 +64,8 @@ const UserNotificationPreferencesView = () => { {loading ? ( + + ) : ( <> @@ -103,8 +106,6 @@ const UserNotificationPreferencesView = () => { - ) : ( - )}