about summary refs log tree commit diff
path: root/app/assets/javascripts/components/reducers/search.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/components/reducers/search.jsx')
-rw-r--r--app/assets/javascripts/components/reducers/search.jsx19
1 files changed, 16 insertions, 3 deletions
diff --git a/app/assets/javascripts/components/reducers/search.jsx b/app/assets/javascripts/components/reducers/search.jsx
index 1767be2c6..e95f9ed79 100644
--- a/app/assets/javascripts/components/reducers/search.jsx
+++ b/app/assets/javascripts/components/reducers/search.jsx
@@ -32,7 +32,7 @@ const normalizeSuggestions = (state, value, accounts, hashtags, statuses) => {
       value: `#${item}`
     }));
 
-    if (value.indexOf('@') === -1 && value.indexOf(' ') === -1 && hashtags.indexOf(value) === -1) {
+    if (value.indexOf('@') === -1 && value.indexOf(' ') === -1 && !value.startsWith('http://') && !value.startsWith('https://') && hashtags.indexOf(value) === -1) {
       hashtagItems.unshift({
         type: 'hashtag',
         id: value,
@@ -40,9 +40,22 @@ const normalizeSuggestions = (state, value, accounts, hashtags, statuses) => {
       });
     }
 
+    if (hashtagItems.length > 0) {
+      newSuggestions.push({
+        title: 'hashtag',
+        items: hashtagItems
+      });
+    }
+  }
+
+  if (statuses.length > 0) {
     newSuggestions.push({
-      title: 'hashtag',
-      items: hashtagItems
+      title: 'status',
+      items: statuses.map(item => ({
+        type: 'status',
+        id: item.id,
+        value: item.id
+      }))
     });
   }