mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Fix searching for additional hashtags in hashtag column (#17054)
This commit is contained in:
parent
1630807ee2
commit
3f382e337d
@ -11,21 +11,22 @@ const mapStateToProps = (state, { columnId }) => {
|
|||||||
return {};
|
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 }) => ({
|
const mapDispatchToProps = (dispatch, { columnId }) => ({
|
||||||
onChange (key, value) {
|
onChange (key, value) {
|
||||||
dispatch(changeColumnParams(columnId, 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);
|
export default connect(mapStateToProps, mapDispatchToProps)(ColumnSettings);
|
||||||
|
Loading…
Reference in New Issue
Block a user