Skip to content

Commit e3b7c9d

Browse files
committed
Uncheck all workspaces when pagination or filter change
1 parent 039d0ba commit e3b7c9d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

site/src/pages/WorkspacesPage/WorkspacesPage.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ const WorkspacesPage: FC = () => {
5959
const updateWorkspace = useWorkspaceUpdate(queryKey)
6060
const [checkedWorkspaces, setCheckedWorkspaces] = useState<Workspace[]>([])
6161
const [isDeletingAll, setIsDeletingAll] = useState(false)
62+
const [urlSearchParams] = searchParamsResult
63+
64+
// We want to uncheck the selected workspaces always when the url changes
65+
// because of filtering or pagination
66+
useEffect(() => {
67+
setCheckedWorkspaces([])
68+
}, [urlSearchParams])
6269

6370
return (
6471
<>

0 commit comments

Comments
 (0)