mirror of
https://github.com/tridactyl/tridactyl.git
synced 2026-09-10 07:16:33 -04:00
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
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:
commit
386efca4ef
|
|
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue