diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-11-26 22:11:09 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2021-11-26 22:58:46 +0100 |
commit | ca5d78816bb31454de28480dec5c6384ed259eef (patch) | |
tree | 931f4c972e55ec032f3f5f6b58621d0380a92a5e /app | |
parent | d5d44b431a8c1570e5db1c5a894a0b72131a3573 (diff) |
[Glitch] Fix searching for additional hashtags in hashtag column
Port 3f382e337d5c40db18995a88c0bf6b1b34f031b7 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/flavours/glitch/features/hashtag_timeline/containers/column_settings_container.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/app/javascript/flavours/glitch/features/hashtag_timeline/containers/column_settings_container.js b/app/javascript/flavours/glitch/features/hashtag_timeline/containers/column_settings_container.js index de1db692d..1cf527573 100644 --- a/app/javascript/flavours/glitch/features/hashtag_timeline/containers/column_settings_container.js +++ b/app/javascript/flavours/glitch/features/hashtag_timeline/containers/column_settings_container.js @@ -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); |