From e7c2d33e58a9f93ba378e1f237a4b3ec362668c7 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Sun, 6 Apr 2025 15:19:16 -0700 Subject: [PATCH] pass around continue for teams enabled --- core/core.ts | 4 ++++ core/protocol/core.ts | 1 + core/protocol/webview.ts | 1 + gui/src/context/Auth.tsx | 20 +++++++++----------- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/core/core.ts b/core/core.ts index 3610f3dab..16edc0cee 100644 --- a/core/core.ts +++ b/core/core.ts @@ -129,6 +129,8 @@ export class Core { this.configHandler.currentProfile?.profileDescription.id || null, organizations: this.configHandler.getSerializedOrgs(), selectedOrgId: this.configHandler.currentOrg.id, + usingContinueForTeams: (await ideSettingsPromise) + .enableControlServerBeta, }); // update additional submenu context providers registered via VSCode API @@ -458,6 +460,8 @@ export class Core { this.configHandler.currentProfile?.profileDescription.id ?? null, organizations: this.configHandler.getSerializedOrgs(), selectedOrgId: this.configHandler.currentOrg.id, + usingContinueForTeams: (await ideSettingsPromise) + .enableControlServerBeta, }; }); diff --git a/core/protocol/core.ts b/core/protocol/core.ts index 83ad67a85..c3a2b1a61 100644 --- a/core/protocol/core.ts +++ b/core/protocol/core.ts @@ -68,6 +68,7 @@ export type ToCoreFromIdeOrWebviewProtocol = { profileId: string | null; organizations: SerializedOrgWithProfiles[]; selectedOrgId: string; + usingContinueForTeams: boolean; }, ]; "config/deleteModel": [{ title: string }, void]; diff --git a/core/protocol/webview.ts b/core/protocol/webview.ts index 74ce31559..6b59fa338 100644 --- a/core/protocol/webview.ts +++ b/core/protocol/webview.ts @@ -15,6 +15,7 @@ export type ToWebviewFromIdeOrCoreProtocol = { profileId: string | null; organizations: SerializedOrgWithProfiles[]; selectedOrgId: string | null; + usingContinueForTeams: boolean; }, void, ]; diff --git a/gui/src/context/Auth.tsx b/gui/src/context/Auth.tsx index 870d9acca..f340d5bbb 100644 --- a/gui/src/context/Auth.tsx +++ b/gui/src/context/Auth.tsx @@ -11,6 +11,7 @@ import React, { useState, } from "react"; import ConfirmationDialog from "../components/dialogs/ConfirmationDialog"; +import { useWebviewListener } from "../hooks/useWebviewListener"; import { selectCurrentOrg, selectSelectedProfile } from "../redux/"; import { useAppDispatch, useAppSelector } from "../redux/hooks"; import { setDialogMessage, setShowDialog } from "../redux/slices/uiSlice"; @@ -121,17 +122,14 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ }); }, []); - // useWebviewListener( - // setControlServerBetaEnabled(settings.enableControlServerBeta); - // "didChangeIdeSettings", - // async (msg) => { - // const { settings } = msg; - // dispatch( - // setLastControlServerBetaEnabledStatus(settings.enableControlServerBeta), - // ); - // }, - // [], - // ); + // Hacky, remove once continue for teams is deprecated + useWebviewListener( + "configUpdate", + async (msg) => { + setControlServerBetaEnabled(msg.usingContinueForTeams); + }, + [], + ); const refreshProfiles = async () => { try {