ui feedback on assistant refresh
This commit is contained in:
parent
8aded10a10
commit
d9145e25ae
2 changed files with 9 additions and 5 deletions
|
|
@ -7,7 +7,7 @@ import {
|
|||
ExclamationTriangleIcon,
|
||||
PlusIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import { useContext, useEffect, useMemo, useRef } from "react";
|
||||
import { useContext, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useAuth } from "../../../context/Auth";
|
||||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import {
|
||||
|
|
@ -33,6 +33,7 @@ import {
|
|||
import { ProfileDescription } from "core/config/ConfigHandler";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { vscCommandCenterInactiveBorder } from "../..";
|
||||
import { cn } from "../../../util/cn";
|
||||
import { ROUTES } from "../../../util/navigation";
|
||||
import { ToolTip } from "../../gui/Tooltip";
|
||||
import { useLump } from "../../mainInput/Lump/LumpContext";
|
||||
|
|
@ -165,6 +166,7 @@ export default function AssistantSelect() {
|
|||
const orgs = useAppSelector((store) => store.profiles.organizations);
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
const { isToolbarExpanded } = useLump();
|
||||
const [loading, setLoading] = useState(false)
|
||||
|
||||
const { profiles, session, login } = useAuth();
|
||||
const navigate = useNavigate();
|
||||
|
|
@ -297,13 +299,15 @@ export default function AssistantSelect() {
|
|||
<span>Assistants</span>
|
||||
<div
|
||||
className="flex cursor-pointer flex-row items-center gap-1 hover:brightness-125"
|
||||
onClick={(e) => {
|
||||
onClick={async (e) => {
|
||||
e.stopPropagation();
|
||||
refreshProfiles();
|
||||
setLoading(true)
|
||||
await refreshProfiles()
|
||||
setLoading(false)
|
||||
buttonRef.current?.click();
|
||||
}}
|
||||
>
|
||||
<ArrowPathIcon className="text-lightgray h-2.5 w-2.5" />
|
||||
<ArrowPathIcon className={cn("text-lightgray h-2.5 w-2.5", loading && 'animate-spin')} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ interface AuthContextType {
|
|||
login: (useOnboarding: boolean) => Promise<boolean>;
|
||||
selectedProfile: ProfileDescription | null;
|
||||
profiles: ProfileDescription[] | null;
|
||||
refreshProfiles: () => void;
|
||||
refreshProfiles: () => Promise<void>;
|
||||
organizations: OrganizationDescription[];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue