Updated featured group_lists to be randomized on init
• Updated: - featured group_lists to be randomized on init
This commit is contained in:
parent
56d0698536
commit
f3e34d40d2
@ -40,7 +40,10 @@ export default function groupLists(state = initialState, action) {
|
|||||||
});
|
});
|
||||||
case GROUPS_FETCH_SUCCESS:
|
case GROUPS_FETCH_SUCCESS:
|
||||||
return state.withMutations((mutable) => {
|
return state.withMutations((mutable) => {
|
||||||
mutable.setIn([action.tab, 'items'], ImmutableList(action.groups.map(item => item.id)))
|
let list = ImmutableList(action.groups.map(item => item.id))
|
||||||
|
if (action.tab === 'featured') list = list.sortBy(Math.random)
|
||||||
|
|
||||||
|
mutable.setIn([action.tab, 'items'], list)
|
||||||
mutable.setIn([action.tab, 'isLoading'], false)
|
mutable.setIn([action.tab, 'isLoading'], false)
|
||||||
mutable.setIn([action.tab, 'isFetched'], true)
|
mutable.setIn([action.tab, 'isFetched'], true)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user