]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix searching for additional hashtags in hashtag column
authorClaire <claire.github-309c@sitedethib.com>
Fri, 26 Nov 2021 21:11:09 +0000 (22:11 +0100)
committerClaire <claire.github-309c@sitedethib.com>
Fri, 26 Nov 2021 21:58:46 +0000 (22:58 +0100)
Port 3f382e337d5c40db18995a88c0bf6b1b34f031b7 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
app/javascript/flavours/glitch/features/hashtag_timeline/containers/column_settings_container.js

index de1db692d1d08e8d8cc27d78d4ada0b24c334dac..1cf52757312671c553c049b85d003aee1bd527c5 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);