diff --git a/clients/tabby-chat-panel/src/index.ts b/clients/tabby-chat-panel/src/index.ts index b8eb83bb0d4a..e7182b8eef5a 100644 --- a/clients/tabby-chat-panel/src/index.ts +++ b/clients/tabby-chat-panel/src/index.ts @@ -374,9 +374,8 @@ export interface ClientApi extends ClientApiMethods { supports: SupportProxy } -// TODO: change this to async export async function createClient(target: HTMLIFrameElement, api: ClientApiMethods): Promise { - const thread = await createThreadFromIframe(target, { + return await createThreadFromIframe(target, { expose: { refresh: api.refresh, onApplyInEditor: api.onApplyInEditor, @@ -395,7 +394,6 @@ export async function createClient(target: HTMLIFrameElement, api: ClientApiMeth readFileContent: api.readFileContent, }, }) - return thread as unknown as Promise } export async function createServer(api: ServerApi): Promise { diff --git a/clients/vscode/src/chat/createClient.ts b/clients/vscode/src/chat/createClient.ts index 27ed309063f6..bfc489400b67 100644 --- a/clients/vscode/src/chat/createClient.ts +++ b/clients/vscode/src/chat/createClient.ts @@ -26,7 +26,7 @@ async function createThreadFromWebview, Target = Re } export async function createClient(webview: Webview, api: ClientApiMethods): Promise { - const thread = await createThreadFromWebview(webview, { + return await createThreadFromWebview(webview, { expose: { refresh: api.refresh, onApplyInEditor: api.onApplyInEditor, @@ -45,5 +45,4 @@ export async function createClient(webview: Webview, api: ClientApiMethods): Pro readFileContent: api.readFileContent, }, }); - return thread as unknown as ServerApi; }