Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix selectionmode on all lists

ammarahm-ed102869eae2f6
diff --git a/apps/mobile/src/views/Favorites/index.js b/apps/mobile/src/views/Favorites/index.js
index ae2b3a925..8e91fc9b2 100644
--- a/apps/mobile/src/views/Favorites/index.js
+++ b/apps/mobile/src/views/Favorites/index.js
@@ -121,11 +121,14 @@ export const Favorites = ({navigation}) => {
marginHorizontal: 0,
}}
colors={colors}
+ 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,
@@ -137,11 +140,14 @@ export const Favorites = ({navigation}) => {
/>
) : (
<NotebookItem
+ 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,
diff --git a/apps/mobile/src/views/Notebook/index.js b/apps/mobile/src/views/Notebook/index.js
index b107322e8..1d1ef297c 100644
--- a/apps/mobile/src/views/Notebook/index.js
+++ b/apps/mobile/src/views/Notebook/index.js
@@ -93,11 +93,15 @@ export const Notebook = ({navigation}) => {
width: selectionMode ? w - 74 : '100%',
marginHorizontal: 0,
}}
+ 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,
diff --git a/apps/mobile/src/views/Notes/index.js b/apps/mobile/src/views/Notes/index.js
index 06cea7a3a..dfae2abfb 100644
--- a/apps/mobile/src/views/Notes/index.js
+++ b/apps/mobile/src/views/Notes/index.js
@@ -82,9 +82,18 @@ export const Notes = ({navigation}) => {
currentEditingNote={
currentEditingNote === item.dateCreated ? currentEditingNote : null
}
+ selectionMode={selectionMode}
onLongPress={() => {
- dispatch({type: ACTIONS.SELECTION_MODE, enabled: !selectionMode});
- dispatch({type: ACTIONS.SELECTED_ITEMS, item: item});
+ if (!selectionMode) {
+ dispatch({
+ type: ACTIONS.SELECTION_MODE,
+ enabled: !selectionMode,
+ });
+ }
+ dispatch({
+ type: ACTIONS.SELECTED_ITEMS,
+ item: item,
+ });
}}
update={() => {}}
item={item}
diff --git a/apps/mobile/src/views/Trash/index.js b/apps/mobile/src/views/Trash/index.js
index d3613e598..6015b3b43 100644
--- a/apps/mobile/src/views/Trash/index.js
+++ b/apps/mobile/src/views/Trash/index.js
@@ -42,11 +42,14 @@ export const Trash = ({navigation}) => {
width: selectionMode ? w - 74 : '100%',
marginHorizontal: 0,
}}
+ 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,
@@ -59,11 +62,14 @@ export const Trash = ({navigation}) => {
/>
) : (
<NotebookItem
+ 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,