mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 10:01:39 -05:00
commandline_frame.ts: Fix compile-time error
10cb692d72
broke the build bot by
introducing type incompatibilites. This is fixed by making sure .catch()
returns an array.
This enables removing the try/catch in the input event handler since
the await won't throw anymore.
This commit is contained in:
parent
ec43f7bb1c
commit
f119a89ac5
1 changed files with 6 additions and 9 deletions
|
@ -250,7 +250,10 @@ export function refresh_completions(exstr) {
|
||||||
if (!activeCompletions) enableCompletions()
|
if (!activeCompletions) enableCompletions()
|
||||||
return Promise.all(
|
return Promise.all(
|
||||||
activeCompletions.map(comp => comp.filter(exstr).then(resizeArea)),
|
activeCompletions.map(comp => comp.filter(exstr).then(resizeArea)),
|
||||||
).catch(err => console.error(err)) // We can't use the regular logging mechanism because the user is using the command line.
|
).catch(err => {
|
||||||
|
console.error(err)
|
||||||
|
return []
|
||||||
|
}) // We can't use the regular logging mechanism because the user is using the command line.
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hidden **/
|
/** @hidden **/
|
||||||
|
@ -260,14 +263,8 @@ clInput.addEventListener("input", () => {
|
||||||
const exstr = clInput.value
|
const exstr = clInput.value
|
||||||
// Schedule completion computation. We do not start computing immediately because this would incur a slow down on quickly repeated input events (e.g. maintaining <Backspace> pressed)
|
// Schedule completion computation. We do not start computing immediately because this would incur a slow down on quickly repeated input events (e.g. maintaining <Backspace> pressed)
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
try {
|
// Make sure the previous computation has ended
|
||||||
// Make sure the previous computation has ended
|
await onInputPromise
|
||||||
await onInputPromise
|
|
||||||
} catch (e) {
|
|
||||||
// we don't actually care because this is the previous computation, which we will throw away
|
|
||||||
logger.warning(e)
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we're not the current completion computation anymore, stop
|
// If we're not the current completion computation anymore, stop
|
||||||
if (exstr != clInput.value) return
|
if (exstr != clInput.value) return
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue