Skip to content

Commit

Permalink
improve app exit
Browse files Browse the repository at this point in the history
  • Loading branch information
fgl27 committed Jul 28, 2024
1 parent 3d34368 commit 02171c7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
12 changes: 9 additions & 3 deletions app/specific/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -757,11 +757,12 @@ function Main_setExitDialog() {
function Main_showExitDialog() {
Main_setExitDialog();
Main_ShowElement('main_dialog_exit');
Main_addEventListener('keydown', Main_ExitDialog);
Main_PreventClick(true, Main_ExitDialog, true);
}

function Main_HideExitDialog() {
Main_removeEventListener('keydown', Main_ExitDialog);
Main_PreventClick(false, Main_ExitDialog);

Main_SwitchScreen();
Main_clearExitDialog();
Main_HideElement('main_dialog_exit');
Expand Down Expand Up @@ -1213,7 +1214,10 @@ function Main_needUpdate(check_version) {
}

function Main_UpdateDialogSet() {
if (!Main_Ischecking) Main_UpdateDialogSetTitle();
if (!Main_Ischecking) {
Main_UpdateDialogSetTitle();
}

Main_RemoveClass('update_dialog_upbutton', 'button_dialog_focused');
Main_RemoveClass('update_dialog_changebutton', 'button_dialog_focused');
Main_AddClass(!Main_UpdateCursor ? 'update_dialog_upbutton' : 'update_dialog_changebutton', 'button_dialog_focused');
Expand Down Expand Up @@ -1858,6 +1862,8 @@ function Main_updateUserFeed() {
}

function Main_ExitDialog(event) {
event.stopPropagation();

switch (event.keyCode) {
case KEY_KEYBOARD_BACKSPACE:
case KEY_RETURN:
Expand Down
8 changes: 6 additions & 2 deletions app/specific/Sidepannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,9 @@ function Sidepannel_KeyEnterUser() {
Sidepannel_Go(Main_History[Main_HistoryPos]);
} else if (Sidepannel_Sidepannel_Pos === 9) {
Sidepannel_Go(Main_Blocked);
} else Sidepannel_KeyEnterBase();
} else {
Sidepannel_KeyEnterBase();
}
}

function Sidepannel_KeyEnterBase() {
Expand Down Expand Up @@ -472,7 +474,9 @@ function Sidepannel_KeyEnter() {
return;
}

if (Sidepannel_Sidepannel_Pos !== 2 && Sidepannel_Sidepannel_Pos !== 13) Sidepannel_Hide();
if (Sidepannel_Sidepannel_Pos !== 2) {
Sidepannel_Hide();
}

if (Sidepannel_Sidepannel_Pos === 2) {
if (AddUser_IsUserSet()) {
Expand Down

0 comments on commit 02171c7

Please sign in to comment.