fix backhandler is not removed when move away from editor

This commit is contained in:
ammarahm-ed
2021-02-27 12:21:25 +05:00
parent dfda1a2f86
commit 4838778178
2 changed files with 28 additions and 9 deletions

View File

@@ -48,7 +48,7 @@ const onChangeTab = async (obj) => {
currentTab = 1;
activateKeepAwake();
eSendEvent('navigate');
eSendEvent(eClearEditor, 'addHandler');
if (!editing.currentlyEditing || !getNote()) {
eSendEvent(eOnLoadNote, {type: 'new'});
editing.currentlyEditing = true;
@@ -60,6 +60,7 @@ const onChangeTab = async (obj) => {
if (obj.from === 1) {
updateStatusBarColor();
deactivateKeepAwake();
eSendEvent(eClearEditor, 'removeHandler');
if (getNote()?.locked) {
eSendEvent(eClearEditor);
}