Make command optional in messageOwnTab to be in line with messageTab

This commit is contained in:
petoncle 2023-10-30 11:34:40 +01:00
parent 50f4288ffc
commit fbc16a57f3
2 changed files with 4 additions and 5 deletions

View file

@ -55,7 +55,6 @@ import state, * as State from "@src/state"
import * as R from "ramda"
import { MinimalKey, minimalKeyFromKeyboardEvent } from "@src/lib/keyseq"
import { TabGroupCompletionSource } from "@src/completions/TabGroup"
import {ownTabId} from "@src/lib/webext";
/** @hidden **/
const logger = new Logger("cmdline")
@ -190,7 +189,7 @@ export function focus() {
commandline_state.clInput.focus()
commandline_state.clInput.removeEventListener("blur", noblur)
commandline_state.clInput.addEventListener("blur", noblur)
Messaging.messageTab(ownTabId(), "buffered_page_keys").then(consumeBufferedPageKeys)
Messaging.messageOwnTab("buffered_page_keys").then(consumeBufferedPageKeys)
}
/** @hidden **/

View file

@ -133,7 +133,7 @@ export async function message<
/** Message the active tab of the currentWindow */
export async function messageActiveTab(
type: TabMessageType,
command: string,
command?: string,
args?: any[],
) {
return messageTab(await activeTabId(), type, command, args)
@ -154,7 +154,7 @@ export async function messageTab(
}
let _ownTabId
export async function messageOwnTab(type: TabMessageType, command, args?) {
export async function messageOwnTab(type: TabMessageType, command?, args?) {
if (_ownTabId === undefined) {
_ownTabId = await ownTabId()
}
@ -165,7 +165,7 @@ export async function messageOwnTab(type: TabMessageType, command, args?) {
export async function messageAllTabs(
type: TabMessageType,
command: string,
command?: string,
args?: any[],
) {
const responses = []