about summary refs log tree commit diff
path: root/app/javascript/mastodon/reducers/search.js
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2017-06-23 23:05:04 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-06-23 16:05:04 +0200
commiteff94164696ecb126ab47b85ee842e65692b649a (patch)
tree7cfb397d8d62e5d4ae96479505a74d1e15e41e00 /app/javascript/mastodon/reducers/search.js
parent6fbb3841a6dd4ec3d84b098437e35f41d41e8407 (diff)
Remove unused variables (#3906)
Diffstat (limited to 'app/javascript/mastodon/reducers/search.js')
-rw-r--r--app/javascript/mastodon/reducers/search.js54
1 files changed, 0 insertions, 54 deletions
diff --git a/app/javascript/mastodon/reducers/search.js b/app/javascript/mastodon/reducers/search.js
index ed395427e..0a3adac05 100644
--- a/app/javascript/mastodon/reducers/search.js
+++ b/app/javascript/mastodon/reducers/search.js
@@ -14,60 +14,6 @@ const initialState = Immutable.Map({
   results: Immutable.Map(),
 });
 
-const normalizeSuggestions = (state, value, accounts, hashtags, statuses) => {
-  let newSuggestions = [];
-
-  if (accounts.length > 0) {
-    newSuggestions.push({
-      title: 'account',
-      items: accounts.map(item => ({
-        type: 'account',
-        id: item.id,
-        value: item.acct,
-      })),
-    });
-  }
-
-  if (value.indexOf('@') === -1 && value.indexOf(' ') === -1 || hashtags.length > 0) {
-    let hashtagItems = hashtags.map(item => ({
-      type: 'hashtag',
-      id: item,
-      value: `#${item}`,
-    }));
-
-    if (value.indexOf('@') === -1 && value.indexOf(' ') === -1 && !value.startsWith('http://') && !value.startsWith('https://') && hashtags.indexOf(value) === -1) {
-      hashtagItems.unshift({
-        type: 'hashtag',
-        id: value,
-        value: `#${value}`,
-      });
-    }
-
-    if (hashtagItems.length > 0) {
-      newSuggestions.push({
-        title: 'hashtag',
-        items: hashtagItems,
-      });
-    }
-  }
-
-  if (statuses.length > 0) {
-    newSuggestions.push({
-      title: 'status',
-      items: statuses.map(item => ({
-        type: 'status',
-        id: item.id,
-        value: item.id,
-      })),
-    });
-  }
-
-  return state.withMutations(map => {
-    map.set('suggestions', newSuggestions);
-    map.set('loaded_value', value);
-  });
-};
-
 export default function search(state = initialState, action) {
   switch(action.type) {
   case SEARCH_CHANGE: