mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-18 19:01:38 +03:00
Merge pull request #2023 from ecency/nt/startup-crash-fix
NT - Startup Crash
This commit is contained in:
commit
e263b397fa
@ -59,17 +59,19 @@ const TabEmptyView = ({
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (!leaderboard.loading) {
|
||||
if (!leaderboard.error && leaderboard.data.length > 0) {
|
||||
_formatRecommendedUsers(leaderboard.data);
|
||||
const {loading, error, data} = leaderboard;
|
||||
if (!loading) {
|
||||
if (!error && data && data.length > 0) {
|
||||
_formatRecommendedUsers(data);
|
||||
}
|
||||
}
|
||||
}, [leaderboard]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!communities.loading) {
|
||||
if (!communities.error && communities.data?.length > 0) {
|
||||
_formatRecommendedCommunities(communities.data);
|
||||
const {loading, error, data} = communities;
|
||||
if (!loading) {
|
||||
if (!error && data && data?.length > 0) {
|
||||
_formatRecommendedCommunities(data);
|
||||
}
|
||||
}
|
||||
}, [communities]);
|
||||
|
@ -69,7 +69,7 @@ export default function (state = initialState, action) {
|
||||
return {
|
||||
...state,
|
||||
communities: {
|
||||
data: action.payload,
|
||||
data: action.payload || [],
|
||||
loading: false,
|
||||
error: false,
|
||||
},
|
||||
@ -96,7 +96,7 @@ export default function (state = initialState, action) {
|
||||
return {
|
||||
...state,
|
||||
subscribedCommunities: {
|
||||
data: action.payload,
|
||||
data: action.payload || [],
|
||||
loading: false,
|
||||
error: false,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user