diff --git a/apps/mobile/index.js b/apps/mobile/index.js index c4f5fdc74..eda942da1 100644 --- a/apps/mobile/index.js +++ b/apps/mobile/index.js @@ -7,8 +7,6 @@ import App from './App'; import {name as appName} from './app.json'; import React from 'react'; import {Provider} from './src/provider'; -import {scale} from './src/common/common'; - const AppProvider = () => { return ( diff --git a/apps/mobile/src/components/ActionSheetComponent/index.js b/apps/mobile/src/components/ActionSheetComponent/index.js index 1d77eba66..c7822cf1f 100644 --- a/apps/mobile/src/components/ActionSheetComponent/index.js +++ b/apps/mobile/src/components/ActionSheetComponent/index.js @@ -346,14 +346,15 @@ export const ActionSheetComponent = ({ .catch(async e => { switch (e.message) { case db.vault.ERRORS.noVault: - close(); openVault(note, false); + close(); break; case db.vault.ERRORS.vaultLocked: openVault(note, true, true); - + close(); break; case db.vault.ERRORS.wrongPassword: + close(); break; } }); diff --git a/apps/mobile/src/components/AddNotebookDialog/index.js b/apps/mobile/src/components/AddNotebookDialog/index.js index 12ef1321a..34e800b46 100644 --- a/apps/mobile/src/components/AddNotebookDialog/index.js +++ b/apps/mobile/src/components/AddNotebookDialog/index.js @@ -9,11 +9,11 @@ import { } from 'react-native'; import {FlatList, TextInput} from 'react-native-gesture-handler'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; - import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common'; import {ACTIONS} from '../../provider/actions'; import {getElevation, ToastEvent, db, DDS} from '../../utils/utils'; import {updateEvent} from '../DialogManager/recievers'; +import {Toast} from '../Toast'; let refs = []; @@ -108,14 +108,8 @@ export class AddNotebookDialog extends React.Component { setTimeout(async () => { let {topics} = this.state; let {toEdit} = this.props; - if (!this.title) - return ToastEvent.show( - 'Title is required', - 'error', - 3000, - () => {}, - '', - ); + if (!this.title || this.title.trim().length === 0) + return ToastEvent.show('Title is required', 'error', 'local'); let id = toEdit && toEdit.id ? toEdit.id : null; @@ -151,11 +145,7 @@ export class AddNotebookDialog extends React.Component { onSubmit = () => { let {topics} = this.state; - if ( - !this.currentInputValue || - this.currentInputValue === '' || - this.currentInputValue === ' ' - ) + if (!this.currentInputValue || this.currentInputValue.trim().length === 0) return; let prevTopics = [...topics]; @@ -335,7 +325,7 @@ export class AddNotebookDialog extends React.Component { onSubmitEditing={() => { this.topicInputRef.focus(); }} - placeholder="write a description" + placeholder="Short description about notebook" placeholderTextColor={colors.icon} /> @@ -494,6 +484,7 @@ export class AddNotebookDialog extends React.Component { + ); } diff --git a/apps/mobile/src/components/DialogManager/recievers.js b/apps/mobile/src/components/DialogManager/recievers.js index 882fb56cc..43dd75ed0 100644 --- a/apps/mobile/src/components/DialogManager/recievers.js +++ b/apps/mobile/src/components/DialogManager/recievers.js @@ -10,6 +10,7 @@ import { eOpenAddTopicDialog, eOpenMoveNoteDialog, eOpenSimpleDialog, + eDispatchAction, } from '../../services/events'; export const ActionSheetEvent = ( diff --git a/apps/mobile/src/services/eventManager.js b/apps/mobile/src/services/eventManager.js index 90af9d54a..4a8f506f8 100644 --- a/apps/mobile/src/services/eventManager.js +++ b/apps/mobile/src/services/eventManager.js @@ -1,4 +1,5 @@ import {DeviceEventEmitter} from 'react-native'; +import {eOpenVaultDialog} from './events'; export const eSubscribeEvent = (eventName, action) => { DeviceEventEmitter.addListener(eventName, action);