improve editor performance

This commit is contained in:
ammarahm-ed
2020-03-03 09:49:54 +05:00
parent 231cde44e1
commit 55a6b11e20
6 changed files with 198 additions and 236 deletions

View File

@@ -12,6 +12,7 @@ import {
simpleDialogEvent,
TEMPLATE_TRASH,
} from '../DialogManager';
import {openEditorAnimation} from '../../utils/animations';
const w = Dimensions.get('window').width;
const h = Dimensions.get('window').height;
@@ -116,14 +117,15 @@ export default class NoteItem extends React.Component {
onPress={() => {
if (item.locked) {
eSendEvent(eOpenVaultDialog, {unlock: true, i: item});
return;
}
if (DDS.isTab) {
eSendEvent(eOnLoadNote, item);
} else if (isTrash) {
simpleDialogEvent(TEMPLATE_TRASH(item.type));
} else {
DDS.isTab
? eSendEvent(eOnLoadNote, item)
: isTrash
? simpleDialogEvent(TEMPLATE_TRASH(item.type))
: NavigationService.navigate('Editor', {
note: item,
});
eSendEvent(eOnLoadNote, item);
openEditorAnimation();
}
}}
style={{