read only mode needs adjustement to 4 fields from 2
This commit is contained in:
@@ -31,7 +31,7 @@ pub async fn handle_read_only_event(
|
||||
}
|
||||
|
||||
if config.is_enter_edit_mode_after(key.code, key.modifiers) {
|
||||
let (current_input, current_pos) = if app_state.ui.show_login {
|
||||
let (current_input, current_pos) = if app_state.ui.show_login || app_state.ui.show_register{
|
||||
(
|
||||
auth_state.get_current_input(),
|
||||
auth_state.current_cursor_pos(),
|
||||
@@ -44,7 +44,7 @@ pub async fn handle_read_only_event(
|
||||
};
|
||||
|
||||
if !current_input.is_empty() && current_pos < current_input.len() {
|
||||
if app_state.ui.show_login {
|
||||
if app_state.ui.show_login || app_state.ui.show_register{
|
||||
auth_state.set_current_cursor_pos(current_pos + 1);
|
||||
*ideal_cursor_column = auth_state.current_cursor_pos();
|
||||
} else {
|
||||
@@ -81,14 +81,14 @@ pub async fn handle_read_only_event(
|
||||
ideal_cursor_column,
|
||||
)
|
||||
.await?
|
||||
} else if app_state.ui.show_login && CONTEXT_ACTIONS_LOGIN.contains(&action) {
|
||||
} else if app_state.ui.show_login || app_state.ui.show_register && CONTEXT_ACTIONS_LOGIN.contains(&action) {
|
||||
crate::tui::functions::login::handle_action(
|
||||
action,
|
||||
auth_state,
|
||||
ideal_cursor_column,
|
||||
)
|
||||
.await?
|
||||
} else if app_state.ui.show_login {
|
||||
} else if app_state.ui.show_login || app_state.ui.show_register{
|
||||
auth_ro::execute_action(
|
||||
action,
|
||||
app_state,
|
||||
@@ -128,14 +128,14 @@ pub async fn handle_read_only_event(
|
||||
ideal_cursor_column,
|
||||
)
|
||||
.await?
|
||||
} else if app_state.ui.show_login && CONTEXT_ACTIONS_LOGIN.contains(&action) {
|
||||
} else if app_state.ui.show_login || app_state.ui.show_register && CONTEXT_ACTIONS_LOGIN.contains(&action) {
|
||||
crate::tui::functions::login::handle_action(
|
||||
action,
|
||||
auth_state,
|
||||
ideal_cursor_column,
|
||||
)
|
||||
.await?
|
||||
} else if app_state.ui.show_login {
|
||||
} else if app_state.ui.show_login || app_state.ui.show_register {
|
||||
auth_ro::execute_action(
|
||||
action,
|
||||
app_state,
|
||||
@@ -174,14 +174,14 @@ pub async fn handle_read_only_event(
|
||||
ideal_cursor_column,
|
||||
)
|
||||
.await?
|
||||
} else if app_state.ui.show_login && CONTEXT_ACTIONS_LOGIN.contains(&action) {
|
||||
} else if app_state.ui.show_login || app_state.ui.show_register && CONTEXT_ACTIONS_LOGIN.contains(&action) {
|
||||
crate::tui::functions::login::handle_action(
|
||||
action,
|
||||
auth_state,
|
||||
ideal_cursor_column,
|
||||
)
|
||||
.await?
|
||||
} else if app_state.ui.show_login {
|
||||
} else if app_state.ui.show_login || app_state.ui.show_register {
|
||||
auth_ro::execute_action(
|
||||
action,
|
||||
app_state,
|
||||
|
||||
Reference in New Issue
Block a user