]> cat aescling's git repositories - mastodon.git/commitdiff
Fix searching for additional hashtags in hashtag column (#17054)
authorClaire <claire.github-309c@sitedethib.com>
Fri, 26 Nov 2021 21:11:09 +0000 (22:11 +0100)
committerGitHub <noreply@github.com>
Fri, 26 Nov 2021 21:11:09 +0000 (22:11 +0100)
app/javascript/mastodon/features/hashtag_timeline/containers/column_settings_container.js

index 5914bbeaf7880d31da7e761f10db6f935eab8a1b..a4f71f8a392695e2f15792c11f5526deaa8524f0 100644 (file)
@@ -11,21 +11,22 @@ const mapStateToProps = (state, { columnId }) => {
     return {};
   }
 
-  return { settings: columns.get(index).get('params') };
+  return {
+    settings: columns.get(index).get('params'),
+    onLoad (value) {
+      return api(() => state).get('/api/v2/search', { params: { q: value, type: 'hashtags' } }).then(response => {
+        return (response.data.hashtags || []).map((tag) => {
+          return { value: tag.name, label: `#${tag.name}` };
+        });
+      });
+    },
+  };
 };
 
 const mapDispatchToProps = (dispatch, { columnId }) => ({
   onChange (key, value) {
     dispatch(changeColumnParams(columnId, key, value));
   },
-
-  onLoad (value) {
-    return api().get('/api/v2/search', { params: { q: value, type: 'hashtags' } }).then(response => {
-      return (response.data.hashtags || []).map((tag) => {
-        return { value: tag.name, label: `#${tag.name}` };
-      });
-    });
-  },
 });
 
 export default connect(mapStateToProps, mapDispatchToProps)(ColumnSettings);