This commit is contained in:
Timothy Jaeryang Baek 2026-11-02 02:15:39 +09:00
parent 1e8a21117e
commit 9260e312fb
2 changed files with 17 additions and 1 deletions

View file

@ -24,7 +24,10 @@ export const updateBrowserSession = (
connection: TerminalConnection,
chatId: string | null,
id: string,
fields: Partial<Pick<BrowserSession, 'url' | 'title' | 'mode'>>
fields: Partial<Pick<BrowserSession, 'url' | 'title' | 'mode'>> & {
active?: boolean;
chat_id?: string;
}
) =>
terminalRequest<BrowserSession>(
connection,

View file

@ -40,6 +40,19 @@
let chromeForward = false;
let frameReady = false;
$: viewUrl = session && sessionConnection ? browserViewUrl(sessionConnection, session) : '';
$: if (session && sessionConnection) {
void updateBrowserSession(sessionConnection, sessionChatId, session.id, { active }).catch(
() => {}
);
}
$: if (session && sessionConnection && chatId && !sessionChatId) {
const savedChatId = chatId;
void updateBrowserSession(sessionConnection, sessionChatId, session.id, {
chat_id: savedChatId
})
.then(() => (sessionChatId = savedChatId))
.catch(() => {});
}
const persist = (url: string, title: string) => {
if (session && sessionConnection)
void updateBrowserSession(sessionConnection, sessionChatId, session.id, { url, title }).catch(