AutosuggestAccountInput: configurable limit prop

profile-avatar-switcher
Alex Gleason 2021-10-14 10:48:17 -05:00
rodzic e8005b9cf6
commit f6f410d276
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -23,6 +23,11 @@ class AutosuggestAccountInput extends ImmutablePureComponent {
intl: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired,
onSelected: PropTypes.func.isRequired,
limit: PropTypes.number,
}
static defaultProps = {
limit: 4,
}
state = {
@ -39,14 +44,10 @@ class AutosuggestAccountInput extends ImmutablePureComponent {
}
handleAccountSearch = throttle(q => {
const { dispatch } = this.props;
const { dispatch, limit } = this.props;
const source = this.refreshCancelToken();
const params = {
q,
resolve: false,
limit: 4,
};
const params = { q, limit, resolve: false };
dispatch(accountSearch(params, source.token))
.then(accounts => {