Add bookmarl_category_needed setting
This commit is contained in:
parent
bd0e2bd796
commit
5a961cc368
13 changed files with 66 additions and 8 deletions
|
@ -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 => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue