refresh profiles done
This commit is contained in:
parent
fb2d2907f7
commit
84856e0331
3 changed files with 14 additions and 3 deletions
|
|
@ -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"]);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue