refactor: change the way updating state is displayed

This commit is contained in:
zhom
2025-08-02 18:17:07 +04:00
parent a5709d95c7
commit 8f05c48594
3 changed files with 59 additions and 8 deletions
+9 -1
View File
@@ -267,6 +267,14 @@ export function ProfilesDataTable({
// Handle icon/checkbox click
const handleIconClick = React.useCallback(
(profileName: string) => {
const profile = filteredData.find((p) => p.name === profileName);
if (!profile) return;
// Prevent selection of profiles whose browsers are updating
if (!browserState.canSelectProfile(profile)) {
return;
}
setShowCheckboxes(true);
setSelectedProfiles((prev) => {
const newSet = new Set(prev);
@@ -289,7 +297,7 @@ export function ProfilesDataTable({
return newSet;
});
},
[onSelectedProfilesChange],
[filteredData, browserState.canSelectProfile, onSelectedProfilesChange],
);
// Handle checkbox change