From a2a4531527c7786af18611e1d423c1504bb9245e Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 28 Mar 2021 11:06:19 +0900 Subject: Send resize message to the sender tab instead of the current tab. Sending resize message to the current table occurs an error, just after switching the tab by a `tabopen` command. The background script unable to connect the current (new tab) because it is in an initialization. --- src/background/usecases/ConsoleUseCase.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/background/usecases') diff --git a/src/background/usecases/ConsoleUseCase.ts b/src/background/usecases/ConsoleUseCase.ts index 329e4ee..7b461e5 100644 --- a/src/background/usecases/ConsoleUseCase.ts +++ b/src/background/usecases/ConsoleUseCase.ts @@ -1,21 +1,14 @@ import { inject, injectable } from "tsyringe"; import ConsoleFrameClient from "../clients/ConsoleFrameClient"; -import TabPresenter from "../presenters/TabPresenter"; @injectable() export default class ConsoleUseCase { constructor( - @inject("TabPresenter") - private readonly tabPresenter: TabPresenter, @inject("ConsoleFrameClient") private readonly consoleFrameClient: ConsoleFrameClient ) {} - async resize(width: number, height: number): Promise { - const tabId = (await this.tabPresenter.getCurrent()).id; - if (typeof tabId === "undefined") { - return; - } + async resize(tabId: number, width: number, height: number): Promise { return this.consoleFrameClient.resize(tabId, width, height); } } -- cgit v1.2.3