fix selection on notebookItem

This commit is contained in:
ammarahm-ed
2020-03-03 11:25:49 +05:00
parent 434f2d87bc
commit e2bc0a7933
2 changed files with 13 additions and 4 deletions

View File

@@ -23,11 +23,16 @@ export const NotebookItem = ({
customStyle,
onLongPress,
navigation,
selectionMode,
}) => {
const [state, dispatch] = useTracked();
const {colors, selectedItemsList} = state;
const navigate = () => {
if (selectionMode) {
onLongPress();
return;
}
isTopic
? NavigationService.navigate('Notes', {
...item,

View File

@@ -222,11 +222,15 @@ export const Folders = ({navigation}) => {
marginHorizontal: 0,
}}
isMove={params.isMove}
selectionMode={selectionMode}
onLongPress={() => {
dispatch({
type: ACTIONS.SELECTION_MODE,
enabled: !selectionMode,
});
if (!selectionMode) {
dispatch({
type: ACTIONS.SELECTION_MODE,
enabled: !selectionMode,
});
}
dispatch({
type: ACTIONS.SELECTED_ITEMS,
item: item,