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
fix menu not open
ammarahm-edaf06dde4f9d7
diff --git a/apps/mobile/src/components/NoteItem/index.js b/apps/mobile/src/components/NoteItem/index.jsindex 38b0e45a6..fe3979291 100644--- a/apps/mobile/src/components/NoteItem/index.js+++ b/apps/mobile/src/components/NoteItem/index.js@@ -33,7 +33,8 @@ export default class NoteItem extends React.Component {shouldComponentUpdate(nextProps, nextState) {if (nextProps.item.locked !== this.cipher.value ||- nextProps.item.colors.length !== this.colors.length+ nextProps.item.colors.length !== this.colors.length ||+ nextProps.selectionMode !== this.props.selectionMode) {return true;} else {@@ -115,7 +116,10 @@ export default class NoteItem extends React.Component {activeOpacity={0.8}onLongPress={() => onLongPress()}onPress={() => {- if (item.locked) {+ if (this.props.selectionMode) {+ this.props.onLongPress();+ return;+ } else if (item.locked) {eSendEvent(eOpenVaultDialog, {unlock: true, i: item});return;}diff --git a/apps/mobile/src/components/NotesList/index.js b/apps/mobile/src/components/NotesList/index.jsindex 5a025e29d..c0600c26e 100644--- a/apps/mobile/src/components/NotesList/index.js+++ b/apps/mobile/src/components/NotesList/index.js@@ -50,8 +50,11 @@ export const NotesList = ({isGrouped = false}) => {currentEditingNote={currentEditingNote === item.id ? currentEditingNote : null}+ selectionMode={selectionMode}onLongPress={() => {- dispatch({type: ACTIONS.SELECTION_MODE, enabled: !selectionMode});+ if (!selectionMode) {+ dispatch({type: ACTIONS.SELECTION_MODE, enabled: true});+ }dispatch({type: ACTIONS.SELECTED_ITEMS, item: item});}}update={() => {diff --git a/apps/mobile/src/components/SideMenu/index.js b/apps/mobile/src/components/SideMenu/index.jsindex 7a25c6da8..5617640e6 100644--- a/apps/mobile/src/components/SideMenu/index.js+++ b/apps/mobile/src/components/SideMenu/index.js@@ -20,6 +20,10 @@ function shouldOpenMenu(dx) {return dx > barrierForward;}+const gestures = {+ enabled: true,+};+export default class SideMenu extends React.Component {constructor(props) {super(props);@@ -70,9 +74,7 @@ export default class SideMenu extends React.Component {),),);- }- UNSAFE_componentWillMount() {this.responder = PanResponder.create({onStartShouldSetResponderCapture: this.onStartShouldSetResponderCapture,onMoveShouldSetPanResponder: this.onMoveShouldSetPanResponder,@@ -111,6 +113,7 @@ export default class SideMenu extends React.Component {const style = [styles.frontView,{width, height},+this.props.animationStyle(this.state.left),];@@ -131,7 +134,7 @@ export default class SideMenu extends React.Component {bottom: 0,backgroundColor: 'black',opacity: this.opacity,- zIndex: 999,+ zIndex: 1,}}/></TouchableWithoutFeedback>@@ -145,7 +148,7 @@ export default class SideMenu extends React.Component {style: {display: 'flex',position: 'absolute',- zIndex: 999,+ zIndex: 1,},});}@@ -185,7 +188,7 @@ export default class SideMenu extends React.Component {style: {display: 'flex',position: 'absolute',- zIndex: 999,+ zIndex: 1,},});if (@@ -236,8 +239,9 @@ export default class SideMenu extends React.Component {this.openMenu(shouldOpenMenu(offsetLeft));}- handleMoveShouldSetPanResponder(e, gestureState) {- if (this.gesturesAreEnabled()) {+ handleMoveShouldSetPanResponder = (e, gestureState) => {+ console.log(gestures.enabled);+ if (gestures.enabled) {const x = Math.round(Math.abs(gestureState.dx));const y = Math.round(Math.abs(gestureState.dy));@@ -253,11 +257,12 @@ export default class SideMenu extends React.Component {: gestureState.moveX < this.props.edgeHitWidth;const swipingToOpen = this.menuPositionMultiplier() * gestureState.dx > 0;+return withinEdgeHitWidth && touchMoved && swipingToOpen;}return false;- }+ };openMenu(isOpen) {const {hiddenMenuOffset, openMenuOffset} = this.state;@@ -300,14 +305,12 @@ export default class SideMenu extends React.Component {}setGestureEnabled(enabled) {- this.isGestureEnabled = enabled;- }-- gesturesAreEnabled() {- return this.isGestureEnabled;+ gestures.enabled = enabled;}componentDidMount() {+ this.setGestureEnabled(true);+eSubscribeEvent(eSendSideMenuOverlayRef, this._getOverlayViewRef);}componentWillUnmount() {@@ -329,7 +332,7 @@ export default class SideMenu extends React.Component {);return (- <View style={styles.container} onLayout={this.onLayoutChange}>+ <View style={[styles.container]} onLayout={this.onLayoutChange}>{menu}{this.getContentView()}diff --git a/apps/mobile/src/views/Editor/index.js b/apps/mobile/src/views/Editor/index.jsindex 1c7c77e40..0e51e7440 100755--- a/apps/mobile/src/views/Editor/index.js+++ b/apps/mobile/src/views/Editor/index.js@@ -39,6 +39,7 @@ import {timeConverter,ToastEvent,} from '../../utils/utils';+import {TabRouter} from 'react-navigation';const EditorWebView = createRef();let note = {};@@ -74,6 +75,7 @@ const Editor = ({navigation, noMenu}) => {}, []);const loadNote = async item => {+ noMenu ? null : SideMenuEvent.disable();if (note && note.id) {dispatch({type: ACTIONS.NOTES});if (item && item.type === 'new') {@@ -327,6 +329,9 @@ const Editor = ({navigation, noMenu}) => {ToastEvent.show('Note Saved!', 'success');}await clearEditor();+ if (noMenu) return true;+ DDS.isTab ? SideMenuEvent.open() : null;+ SideMenuEvent.enable();return true;} else {@@ -375,16 +380,6 @@ const Editor = ({navigation, noMenu}) => {};}, [noMenu]);- useEffect(() => {- noMenu ? null : SideMenuEvent.disable();-- return () => {- if (noMenu) return;- DDS.isTab ? SideMenuEvent.open() : null;- SideMenuEvent.enable();- };- });-return (<SafeAreaViewstyle={{@@ -417,7 +412,8 @@ const Editor = ({navigation, noMenu}) => {ToastEvent.show('Note Saved!', 'success');}await clearEditor();- ToastEvent.show('Note Saved!', 'success');+ DDS.isTab ? SideMenuEvent.open() : null;+ SideMenuEvent.enable();}}}style={{