Merge pull request #3330 from Infisical/fix/snapshotsInfiniteLoading

Fix infinite loading icon on snapshot button
This commit is contained in:
carlosmonastyrski
2025-03-28 16:51:29 -03:00
committed by GitHub
2 changed files with 9 additions and 5 deletions
@@ -329,7 +329,7 @@ export const MinimizedOrgSidebar = () => {
)} )}
</Link> </Link>
<div className="my-1 w-full bg-mineshaft-500" style={{ height: "1px" }} /> <div className="my-1 w-full bg-mineshaft-500" style={{ height: "1px" }} />
<DropdownMenu open={open} onOpenChange={setOpen}> <DropdownMenu open={open} onOpenChange={setOpen} modal={false}>
<DropdownMenuTrigger <DropdownMenuTrigger
onMouseEnter={() => setOpen(true)} onMouseEnter={() => setOpen(true)}
onMouseLeave={() => setOpen(false)} onMouseLeave={() => setOpen(false)}
@@ -396,7 +396,7 @@ export const MinimizedOrgSidebar = () => {
: "mb-4" : "mb-4"
} flex w-full cursor-default flex-col items-center px-1 text-sm text-mineshaft-400`} } flex w-full cursor-default flex-col items-center px-1 text-sm text-mineshaft-400`}
> >
<DropdownMenu open={openSupport} onOpenChange={setOpenSupport}> <DropdownMenu open={openSupport} onOpenChange={setOpenSupport} modal={false}>
<DropdownMenuTrigger <DropdownMenuTrigger
onMouseEnter={() => setOpenSupport(true)} onMouseEnter={() => setOpenSupport(true)}
onMouseLeave={() => setOpenSupport(false)} onMouseLeave={() => setOpenSupport(false)}
@@ -479,7 +479,7 @@ export const MinimizedOrgSidebar = () => {
</button> </button>
</Tooltip> </Tooltip>
)} )}
<DropdownMenu open={openUser} onOpenChange={setOpenUser}> <DropdownMenu open={openUser} onOpenChange={setOpenUser} modal={false}>
<DropdownMenuTrigger <DropdownMenuTrigger
onMouseEnter={() => setOpenUser(true)} onMouseEnter={() => setOpenUser(true)}
onMouseLeave={() => setOpenUser(false)} onMouseLeave={() => setOpenUser(false)}
@@ -250,7 +250,11 @@ const Page = () => {
limit: 10 limit: 10
}); });
const { data: snapshotCount, isPending: isSnapshotCountLoading } = useGetWsSnapshotCount({ const {
data: snapshotCount,
isPending: isSnapshotCountLoading,
isFetching: isSnapshotCountFetching
} = useGetWsSnapshotCount({
workspaceId, workspaceId,
environment, environment,
directory: secretPath, directory: secretPath,
@@ -414,7 +418,7 @@ const Page = () => {
onSearchChange={handleSearchChange} onSearchChange={handleSearchChange}
onToggleTagFilter={handleTagToggle} onToggleTagFilter={handleTagToggle}
snapshotCount={snapshotCount || 0} snapshotCount={snapshotCount || 0}
isSnapshotCountLoading={isSnapshotCountLoading} isSnapshotCountLoading={isSnapshotCountLoading && isSnapshotCountFetching}
onToggleRowType={handleToggleRowType} onToggleRowType={handleToggleRowType}
onClickRollbackMode={() => handlePopUpToggle("snapshots", true)} onClickRollbackMode={() => handlePopUpToggle("snapshots", true)}
protectedBranchPolicyName={boardPolicy?.name} protectedBranchPolicyName={boardPolicy?.name}