mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-06-12 09:47:51 +02:00
refactor: change the way updating state is displayed
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user