You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
Async functions now return bluebird promises, remove redundant Promise.resolve
This commit is contained in:
@@ -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
|
// single timeout to reject the Promise.all, reflect each one and once they've all
|
||||||
// settled, filter for the fulfilled ones
|
// settled, filter for the fulfilled ones
|
||||||
PROVIDERS.map((provider) => {
|
PROVIDERS.map((provider) => {
|
||||||
// Convert to bluebird promise so that we can do a timeout
|
return provider
|
||||||
const p = Promise.resolve(provider.getCompletions(query, selection, force));
|
.getCompletions(query, selection, force)
|
||||||
return p.timeout(PROVIDER_COMPLETION_TIMEOUT).reflect();
|
.timeout(PROVIDER_COMPLETION_TIMEOUT)
|
||||||
|
.reflect();
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user