return promise from updating autocomplete

so one can await if needed
This commit is contained in:
Bruno Windels 2019-08-27 16:12:44 +02:00
parent 0f6465a1db
commit f76a23d5dd
2 changed files with 5 additions and 3 deletions

View file

@ -304,7 +304,7 @@ export default class BasicMessageEditor extends React.Component {
// not really, but we could not serialize the parts, and just change the autoCompleter
partCreator.setAutoCompleteCreator(autoCompleteCreator(
() => this._autocompleteRef,
query => this.setState({query}),
query => new Promise(resolve => this.setState({query}, resolve)),
));
this.historyManager = new HistoryManager(partCreator);
// initial render of model