Fix collectable collection selecting initial items lazily

This commit is contained in:
schroda
2026-03-20 01:30:01 +01:00
parent 33c55f8b85
commit b63c8a548e
3 changed files with 13 additions and 6 deletions

View File

@@ -126,10 +126,13 @@ export function CategorySelect(props: CategorySelectProps) {
'categoriesToAdd' | 'categoriesToRemove'
>(allCategories.length, {
currentKey: 'categoriesToAdd',
initialState: {
categoriesToAdd: [...mangaCategoryIds, ...defaultCategoryIds],
categoriesToRemove: [],
},
initialState: useMemo(
() => ({
categoriesToAdd: [...mangaCategoryIds, ...defaultCategoryIds],
categoriesToRemove: [],
}),
[mangaCategoryIds, defaultCategoryIds],
),
});
useEffect(() => {