diff --git a/ui/src/ui/app-render.helpers.node.test.ts b/ui/src/ui/app-render.helpers.node.test.ts
index 5e343632816..d02706f67e8 100644
--- a/ui/src/ui/app-render.helpers.node.test.ts
+++ b/ui/src/ui/app-render.helpers.node.test.ts
@@ -1061,7 +1061,7 @@ describe("switchChatSession", () => {
loadChatHistoryMock.mockResolvedValue(undefined);
loadSessionsMock.mockResolvedValue(undefined);
- switchChatSession(state, "agent:main:test-b");
+ void switchChatSession(state, "agent:main:test-b");
await Promise.resolve();
expect(state.chatQueue).toStrictEqual([]);
@@ -1133,10 +1133,10 @@ describe("switchChatSession", () => {
loadChatHistoryMock.mockResolvedValue(undefined);
loadSessionsMock.mockResolvedValue(undefined);
- switchChatSession(state, "agent:main:other");
+ void switchChatSession(state, "agent:main:other");
expect(state.chatQueue).toStrictEqual([]);
- switchChatSession(state, "main");
+ void switchChatSession(state, "main");
expect(state.chatQueue).toEqual([{ id: "queued-1", text: "message B", createdAt: 1 }]);
});
@@ -1180,7 +1180,7 @@ describe("switchChatSession", () => {
loadChatHistoryMock.mockResolvedValue(undefined);
loadSessionsMock.mockResolvedValue(undefined);
- switchChatSession(state, "main");
+ void switchChatSession(state, "main");
await Promise.resolve();
expect(
diff --git a/ui/src/ui/app-render.helpers.ts b/ui/src/ui/app-render.helpers.ts
index 859b0f0dff5..2e6fbad7345 100644
--- a/ui/src/ui/app-render.helpers.ts
+++ b/ui/src/ui/app-render.helpers.ts
@@ -282,7 +282,13 @@ function renderCronFilterIcon(hiddenCount: number) {
}
export function renderChatSessionSelect(state: AppViewState) {
- return renderChatSessionSelectBase(state, switchChatSession, { surface: "desktop" });
+ return renderChatSessionSelectBase(
+ state,
+ (targetState, nextSessionKey) => {
+ void switchChatSession(targetState, nextSessionKey);
+ },
+ { surface: "desktop" },
+ );
}
function chatAutoScrollLabel(mode: ChatAutoScrollMode) {
@@ -586,7 +592,13 @@ export function renderChatMobileToggle(state: AppViewState) {
}}
>
- ${renderChatSessionSelectBase(state, switchChatSession, { surface: "mobile" })}
+ ${renderChatSessionSelectBase(
+ state,
+ (targetState, nextSessionKey) => {
+ void switchChatSession(targetState, nextSessionKey);
+ },
+ { surface: "mobile" },
+ )}
${renderChatAutoScrollToggle(state)}