Added trending_hashtags to redux to fetch on isXS in SearchLayout
• Added: - trending_hashtags to redux to fetch on isXS in SearchLayout • Removed: - trending_hashtags from initial state
This commit is contained in:
@@ -52,6 +52,7 @@ import suggestions from './suggestions'
|
||||
import timelines from './timelines'
|
||||
import timeline_injections from './timeline_injections'
|
||||
import toasts from './toasts'
|
||||
import trending_hashtags from './trending_hashtags'
|
||||
import user from './user'
|
||||
import user_lists from './user_lists'
|
||||
|
||||
@@ -109,6 +110,7 @@ const reducers = {
|
||||
timelines,
|
||||
timeline_injections,
|
||||
toasts,
|
||||
trending_hashtags,
|
||||
user,
|
||||
user_lists,
|
||||
}
|
||||
|
||||
22
app/javascript/gabsocial/reducers/trending_hashtags.js
Normal file
22
app/javascript/gabsocial/reducers/trending_hashtags.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Map as ImmutableMap } from 'immutable'
|
||||
import {
|
||||
TRENDING_HASHTAGS_FETCH_REQUEST,
|
||||
TRENDING_HASHTAGS_FETCH_SUCCESS,
|
||||
TRENDING_HASHTAGS_FETCH_FAIL,
|
||||
} from '../actions/trending_hashtags'
|
||||
|
||||
const initialState = ImmutableMap({
|
||||
fetched: false,
|
||||
items: []
|
||||
})
|
||||
|
||||
export default function trending_hashtags(state = initialState, action) {
|
||||
switch (action.type) {
|
||||
case TRENDING_HASHTAGS_FETCH_FAIL:
|
||||
return state.set('fetched', true).set('items', [])
|
||||
case TRENDING_HASHTAGS_FETCH_SUCCESS:
|
||||
return state.set('fetched', true).set('items', action.hashtags)
|
||||
default:
|
||||
return state
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user