mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
Async functions now return bluebird
promises, remove redundant Promise.resolve
This commit is contained in:
parent
c47398e7fe
commit
dcc4db53f9
@ -58,9 +58,10 @@ export async function getCompletions(query: string, selection: SelectionRange, f
|
||||
// single timeout to reject the Promise.all, reflect each one and once they've all
|
||||
// settled, filter for the fulfilled ones
|
||||
PROVIDERS.map((provider) => {
|
||||
// Convert to bluebird promise so that we can do a timeout
|
||||
const p = Promise.resolve(provider.getCompletions(query, selection, force));
|
||||
return p.timeout(PROVIDER_COMPLETION_TIMEOUT).reflect();
|
||||
return provider
|
||||
.getCompletions(query, selection, force)
|
||||
.timeout(PROVIDER_COMPLETION_TIMEOUT)
|
||||
.reflect();
|
||||
}),
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user