fix favorite from multi-select

This commit is contained in:
ammarahm-ed
2020-03-02 11:13:40 +05:00
parent cf8564f654
commit 6dc985bf13

View File

@@ -125,10 +125,14 @@ export const SelectionHeader = ({navigation}) => {
if (selectedItemsList.length > 0) { if (selectedItemsList.length > 0) {
selectedItemsList.forEach(async item => { selectedItemsList.forEach(async item => {
await db.notes.note(item.id).favorite(); await db.notes.note(item.id).favorite();
});
dispatch({type: ACTIONS.SELECTION_MODE, enabled: false});
dispatch({type: ACTIONS.NOTES}); dispatch({type: ACTIONS.NOTES});
dispatch({type: ACTIONS.FAVORITES});
});
dispatch({type: ACTIONS.SELECTION_MODE, enabled: false});
dispatch({type: ACTIONS.CLEAR_SELECTION}); dispatch({type: ACTIONS.CLEAR_SELECTION});
ToastEvent.show('Notes added to favorites', 'success'); ToastEvent.show('Notes added to favorites', 'success');
} }
}}> }}>