Add bookmarl_category_needed setting

This commit is contained in:
KMY 2023-08-26 18:27:17 +09:00
parent bd0e2bd796
commit 5a961cc368
13 changed files with 66 additions and 8 deletions

View file

@ -20,7 +20,14 @@ import {
const initialState = ImmutableMap();
const normalizeBookmarkCategory = (state, category) => state.set(category.id, fromJS(category));
const normalizeBookmarkCategory = (state, category) => {
const old = state.get(category.id);
state = state.set(category.id, fromJS(category));
if (old) {
state = state.setIn([category.id, 'items'], old.get('items'));
}
return state;
};
const normalizeBookmarkCategories = (state, bookmarkCategories) => {
bookmarkCategories.forEach(bookmarkCategory => {