Merge pull request #5422 from tridactyl/fillcmdline_tmp_no_wait
Some checks are pending
e2e / test (firefox, ubuntu) (push) Waiting to run
e2e / test (firefox, windows) (push) Waiting to run
e2e / test (firefoxesr, ubuntu) (push) Waiting to run
lint / lint (lint) (push) Waiting to run
lint / lint (mozilla) (push) Waiting to run
lint / lint (unit) (push) Waiting to run
Website / build (push) Waiting to run
Website / deploy (push) Blocked by required conditions

Fix #5402: make fillcmdline_tmp return early
This commit is contained in:
Oliver Blanthorn 2026-07-04 13:33:23 +00:00 committed by GitHub
commit 386efca4ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4048,18 +4048,16 @@ export function fillcmdline_nofocus(...strarr: string[]) {
/** Shows str in the command line for ms milliseconds. Recommended duration: 3000ms. */
//#content
export async function fillcmdline_tmp(ms: number, ...strarr: string[]) {
export function fillcmdline_tmp(ms: number, ...strarr: string[]) {
showcmdline(false)
Messaging.messageOwnTab("commandline_frame", "fillcmdline", [strarr.join(" "), false, false])
return new Promise<void>(resolve =>
setTimeout(async () => {
if (document.activeElement?.id !== "cmdline_iframe") {
CommandLineContent.hide_and_blur()
resolve(Messaging.messageOwnTab("commandline_frame", "clear", [true]))
}
resolve()
}, ms),
)
const done = Messaging.messageOwnTab("commandline_frame", "fillcmdline", [strarr.join(" "), false, false])
setTimeout(() => {
if (document.activeElement?.id !== "cmdline_iframe") {
CommandLineContent.hide_and_blur()
Messaging.messageOwnTab("commandline_frame", "clear", [true])
}
}, ms)
return done
}
/**