From 2d1fdcf6fbb012c499dae962ae450e9d8efb5d8f Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Mon, 9 Nov 2020 01:31:32 -0600 Subject: [PATCH] Removed unused hashtag redux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Removed: - unused hashtag redux --- app/javascript/gabsocial/actions/hashtags.js | 39 ------------------- app/javascript/gabsocial/reducers/hashtags.js | 27 ------------- app/javascript/gabsocial/reducers/index.js | 2 - 3 files changed, 68 deletions(-) delete mode 100644 app/javascript/gabsocial/actions/hashtags.js delete mode 100644 app/javascript/gabsocial/reducers/hashtags.js diff --git a/app/javascript/gabsocial/actions/hashtags.js b/app/javascript/gabsocial/actions/hashtags.js deleted file mode 100644 index 7f35102f..00000000 --- a/app/javascript/gabsocial/actions/hashtags.js +++ /dev/null @@ -1,39 +0,0 @@ -import api from '../api'; - -export const HASHTAGS_FETCH_REQUEST = 'HASHTAGS_FETCH_REQUEST'; -export const HASHTAGS_FETCH_SUCCESS = 'HASHTAGS_FETCH_SUCCESS'; -export const HASHTAGS_FETCH_FAIL = 'HASHTAGS_FETCH_FAIL'; - -export function fetchHashtags() { - return (dispatch, getState) => { - dispatch(fetchHashtagsRequest()); - - api(getState).get('/api/v1/trends').then(response => { - dispatch(fetchHashtagsSuccess(response.data)); - }).catch(error => dispatch(fetchHashtagsFail(error))); - }; -}; - -export function fetchHashtagsRequest() { - return { - type: HASHTAGS_FETCH_REQUEST, - skipLoading: true, - }; -}; - -export function fetchHashtagsSuccess(tags) { - return { - tags, - type: HASHTAGS_FETCH_SUCCESS, - skipLoading: true, - }; -}; - -export function fetchHashtagsFail(error) { - return { - error, - type: HASHTAGS_FETCH_FAIL, - skipLoading: true, - skipAlert: true, - }; -}; diff --git a/app/javascript/gabsocial/reducers/hashtags.js b/app/javascript/gabsocial/reducers/hashtags.js deleted file mode 100644 index 43b0f2dd..00000000 --- a/app/javascript/gabsocial/reducers/hashtags.js +++ /dev/null @@ -1,27 +0,0 @@ -import { - HASHTAGS_FETCH_REQUEST, - HASHTAGS_FETCH_SUCCESS, - HASHTAGS_FETCH_FAIL, -} from '../actions/hashtags'; -import { Map as ImmutableMap, List as ImmutableList, fromJS } from 'immutable'; - -const initialState = ImmutableMap({ - items: ImmutableList(), - isLoading: false, -}); - -export default function hashtagsReducer(state = initialState, action) { - switch(action.type) { - case HASHTAGS_FETCH_REQUEST: - return state.set('isLoading', true); - case HASHTAGS_FETCH_SUCCESS: - return state.withMutations(map => { - map.set('items', fromJS(action.tags.map((x => x)))) - map.set('isLoading', false); - }); - case HASHTAGS_FETCH_FAIL: - return state.set('isLoading', false); - default: - return state; - } -}; diff --git a/app/javascript/gabsocial/reducers/index.js b/app/javascript/gabsocial/reducers/index.js index 9195d1e4..9e7048ea 100644 --- a/app/javascript/gabsocial/reducers/index.js +++ b/app/javascript/gabsocial/reducers/index.js @@ -12,7 +12,6 @@ import group_categories from './group_categories' import group_editor from './group_editor' import group_lists from './group_lists' import group_relationships from './group_relationships' -import hashtags from './hashtags' import height_cache from './height_cache' import links from './links.js' import lists from './lists' @@ -57,7 +56,6 @@ const reducers = { group_editor, group_lists, group_relationships, - hashtags, height_cache, links, lists,