From 84856e0331a40a71dba143ad31aeda449977c129 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 26 Feb 2025 16:12:02 -0800 Subject: [PATCH] refresh profiles done --- gui/src/context/Auth.tsx | 6 ++++-- gui/src/pages/config/index.tsx | 9 +++++++++ gui/src/pages/gui/StreamError.tsx | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gui/src/context/Auth.tsx b/gui/src/context/Auth.tsx index d5ec8fa42..807065019 100644 --- a/gui/src/context/Auth.tsx +++ b/gui/src/context/Auth.tsx @@ -176,11 +176,13 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ }); }, []); - const refreshProfiles = () => { + const refreshProfiles = async () => { try { - ideMessenger.post("config/refreshProfiles", undefined); + await ideMessenger.request("config/refreshProfiles", undefined); + ideMessenger.post("showToast", ["info", "Config refreshed"]); } catch (e) { console.error("Failed to refresh profiles", e); + ideMessenger.post("showToast", ["error", "Failed to refresh config"]); } }; diff --git a/gui/src/pages/config/index.tsx b/gui/src/pages/config/index.tsx index dcf1a6bf0..9f385c9c9 100644 --- a/gui/src/pages/config/index.tsx +++ b/gui/src/pages/config/index.tsx @@ -42,6 +42,7 @@ function ConfigPage() { selectedProfile, controlServerBetaEnabled, selectedOrganization, + refreshProfiles, } = useAuth(); const changeProfileId = (id: string) => { @@ -297,6 +298,14 @@ function ConfigPage() { : "Open Workspace"} )} + {hubEnabled && session && ( +
+ {`If your hub secret values may have changed, refresh your assistants`} + + Refresh assistants + +
+ )} ) : (
Loading...
diff --git a/gui/src/pages/gui/StreamError.tsx b/gui/src/pages/gui/StreamError.tsx index 867cd044b..36d3853b1 100644 --- a/gui/src/pages/gui/StreamError.tsx +++ b/gui/src/pages/gui/StreamError.tsx @@ -160,7 +160,7 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => {
{`If your hub secret values may have changed, refresh your assistants`} - Refresh profile secrets + Refresh assistant secrets
)}