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 = () => { - ) : ( - )}