1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-08-07 11:55:17 +02:00

Fixed state bug while updating categories. Fixed bug with bookmarks not being displayed under categories.

This commit is contained in:
Paweł Malak 2021-11-09 15:51:50 +01:00
parent 0d5a4c418e
commit f127a354ef
5 changed files with 18 additions and 14 deletions

View file

@ -69,7 +69,10 @@ export const bookmarksReducer = (
...state,
categories: [
...state.categories.slice(0, pinnedCategoryIdx),
action.payload,
{
...action.payload,
bookmarks: [...state.categories[pinnedCategoryIdx].bookmarks],
},
...state.categories.slice(pinnedCategoryIdx + 1),
],
};
@ -96,7 +99,10 @@ export const bookmarksReducer = (
...state,
categories: [
...state.categories.slice(0, updatedCategoryIdx),
action.payload,
{
...action.payload,
bookmarks: [...state.categories[updatedCategoryIdx].bookmarks],
},
...state.categories.slice(updatedCategoryIdx + 1),
],
};