A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
compare items in list based on id
ammarahm-ed6be35c15f05a
diff --git a/apps/mobile/src/provider/Reducer.js b/apps/mobile/src/provider/Reducer.jsindex 9e6566fec..1a5a39be9 100644--- a/apps/mobile/src/provider/Reducer.js+++ b/apps/mobile/src/provider/Reducer.js@@ -141,11 +141,12 @@ export const reducer = (state, action) => {}case Actions.SELECTED_ITEMS: {let selectedItems = [...state.selectedItemsList];- if (selectedItems.includes(action.item)) {+ if (selectedItems.findIndex(item => item.id === action.item.id) !== -1) {selectedItems.splice(selectedItems.indexOf(action.item), 1);} else {selectedItems.push(action.item);}+ selectedItems = [...new Set(selectedItems)];history.selectedItemsList = selectedItems;if (selectedItems.length === 0) {eSendEvent(eOpenSideMenu);