Skip to content

Commit

Permalink
values of .hideHUD: add "auto"
Browse files Browse the repository at this point in the history
  • Loading branch information
gdh1995 committed Mar 10, 2024
1 parent 4841b58 commit 9f73509
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions background/all_commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ set_bgC_([
key = _key && typeof _key === "string" ? stripKey_(_key).trim() : ""
key = key.length > 1 || key.length === 1 && !(<RegExpI> /[0-9a-z]/i).test(key)
&& key === key.toUpperCase() && key === key.toLowerCase() ? key : "" // refuse letters in other languages
const hideHUD = get_cOptions<C.insertMode>().hideHUD ?? get_cOptions<C.insertMode>().hideHud
?? (!key && settingsCache_.hideHud)
const rawHideHUD = get_cOptions<C.insertMode>().hideHUD ?? get_cOptions<C.insertMode>().hideHud
?? settingsCache_.hideHud, hideHUD = rawHideHUD === "auto" ? !key : rawHideHUD
void Promise.resolve(trans_("globalInsertMode", [key && ": " + (key.length === 1 ? `" ${key} "` : `<${key}>`)]))
.then((msg): void => {
sendFgCmd(kFgCmd.insertMode, !hideHUD, Object.assign<CmdOptions[kFgCmd.insertMode], Req.FallbackOptions>({
Expand Down
1 change: 1 addition & 0 deletions background/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const ContentSettings_ = OnChrome ? {
}
if (!bcs) {
showHUD("Has not permitted to set contentSettings")
setTimeout((): void => { focusOrLaunch_({ u: CONST_.OptionsPage_ + "#optionalPermissions" }) }, 800)
return true;
}
if (!bcs[contentType] || (<RegExpOne> /^[A-Z]/).test(contentType) || !bcs[contentType].get) {
Expand Down
2 changes: 1 addition & 1 deletion background/typed_commands.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface BgCmdOptions {
} & UserSedOptions & CSSOptions & Req.FallbackOptions & OpenUrlOptions
[kBgCmd.insertMode]: {
key: string
hideHUD: boolean | "force" | "always"
hideHUD: boolean | "force" | "always" | "auto"
/** (deprecated) */ hideHud: boolean
insert: boolean
passExitKey: boolean
Expand Down

0 comments on commit 9f73509

Please sign in to comment.