refresh profiles done

This commit is contained in:
Dallin Romney 2025-02-26 16:12:02 -08:00
parent fb2d2907f7
commit 84856e0331
3 changed files with 14 additions and 3 deletions

View file

@ -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"]);
}
};

View file

@ -42,6 +42,7 @@ function ConfigPage() {
selectedProfile,
controlServerBetaEnabled,
selectedOrganization,
refreshProfiles,
} = useAuth();
const changeProfileId = (id: string) => {
@ -297,6 +298,14 @@ function ConfigPage() {
: "Open Workspace"}
</SecondaryButton>
)}
{hubEnabled && session && (
<div className="flex flex-col gap-1">
<span>{`If your hub secret values may have changed, refresh your assistants`}</span>
<SecondaryButton onClick={refreshProfiles}>
Refresh assistants
</SecondaryButton>
</div>
)}
</>
) : (
<div>Loading...</div>

View file

@ -160,7 +160,7 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => {
<div className="flex flex-col gap-1">
<span>{`If your hub secret values may have changed, refresh your assistants`}</span>
<SecondaryButton onClick={handleRefreshProfiles}>
Refresh profile secrets
Refresh assistant secrets
</SecondaryButton>
</div>
)}