diff --git a/base_pack/totp/application.fam b/base_pack/totp/application.fam index 73dd1100679..33939780481 100644 --- a/base_pack/totp/application.fam +++ b/base_pack/totp/application.fam @@ -7,7 +7,7 @@ App( requires=["gui", "cli", "dialogs", "storage", "input", "notification", "bt"], stack_size=2 * 1024, order=20, - fap_version="5.100", + fap_version="5.110", fap_author="Alexander Kopachov (@akopachov)", fap_description="Software-based TOTP/HOTP authenticator for Flipper Zero device", fap_weburl="https://github.com/akopachov/flipper-zero_authenticator", diff --git a/base_pack/totp/ui/scenes/authenticate/totp_scene_authenticate.c b/base_pack/totp/ui/scenes/authenticate/totp_scene_authenticate.c index 27307b2fd60..87e1b50c6ca 100644 --- a/base_pack/totp/ui/scenes/authenticate/totp_scene_authenticate.c +++ b/base_pack/totp/ui/scenes/authenticate/totp_scene_authenticate.c @@ -1,6 +1,9 @@ #include "totp_scene_authenticate.h" #include #include +#if __has_include() +#include +#endif #include "../../../types/common.h" #include "../../constants.h" #include "../../../services/config/config.h" @@ -79,12 +82,18 @@ bool totp_scene_authenticate_handle_event( return true; } - if(event->input.type == InputTypeLong && event->input.key == InputKeyBack) { + if(event->input.type == InputTypeShort && event->input.key == InputKeyBack) { return false; } SceneState* scene_state = plugin_state->current_scene_state; - if(event->input.type == InputTypePress) { + if((event->input.type == InputTypeLong || event->input.type == InputTypeRepeat) && + event->input.key == InputKeyBack) { + if(scene_state->code_length > 0) { + scene_state->code_input[scene_state->code_length - 1] = 0; + scene_state->code_length--; + } + } else if(event->input.type == InputTypePress) { switch(event->input.key) { case InputKeyUp: if(scene_state->code_length < MAX_CODE_LENGTH) { @@ -139,17 +148,17 @@ bool totp_scene_authenticate_handle_event( SCREEN_HEIGHT_CENTER - 5, AlignCenter, AlignCenter); +#if __has_include() + dialog_message_set_icon(message, &I_WarningDolphinFlip_45x42, 83, 22); +#else dialog_message_set_icon(message, &I_DolphinCommon_56x48, 72, 17); +#endif dialog_message_show(plugin_state->dialogs_app, message); dialog_message_free(message); } break; } case InputKeyBack: - if(scene_state->code_length > 0) { - scene_state->code_input[scene_state->code_length - 1] = 0; - scene_state->code_length--; - } break; default: break; diff --git a/base_pack/totp/ui/scenes/generate_token/totp_scene_generate_token.c b/base_pack/totp/ui/scenes/generate_token/totp_scene_generate_token.c index 5779fbbde78..45167f05a11 100644 --- a/base_pack/totp/ui/scenes/generate_token/totp_scene_generate_token.c +++ b/base_pack/totp/ui/scenes/generate_token/totp_scene_generate_token.c @@ -335,7 +335,7 @@ bool totp_scene_generate_token_handle_event( return true; } - if(event->input.type == InputTypeLong && event->input.key == InputKeyBack) { + if(event->input.type == InputTypePress && event->input.key == InputKeyBack) { return false; } diff --git a/base_pack/totp/ui/scenes/standby/standby.c b/base_pack/totp/ui/scenes/standby/standby.c index 5cd6bae6a76..6ac4d6548d4 100644 --- a/base_pack/totp/ui/scenes/standby/standby.c +++ b/base_pack/totp/ui/scenes/standby/standby.c @@ -1,12 +1,19 @@ #include "standby.h" +#if __has_include() +#include +#endif #include #include "../../constants.h" void totp_scene_standby_render(Canvas* const canvas) { +#if __has_include() + canvas_draw_icon(canvas, SCREEN_WIDTH - 50, SCREEN_HEIGHT - 44, &I_WarningDolphinFlip_45x42); +#else canvas_draw_icon(canvas, SCREEN_WIDTH - 56, SCREEN_HEIGHT - 48, &I_DolphinCommon_56x48); +#endif canvas_set_font(canvas, FontPrimary); canvas_draw_str_aligned(canvas, 5, 10, AlignLeft, AlignTop, "CLI command"); canvas_draw_str_aligned(canvas, 5, 24, AlignLeft, AlignTop, "is running now"); -} \ No newline at end of file +} diff --git a/base_pack/totp/version.h b/base_pack/totp/version.h index d0cc4d0bb7b..19209af49a3 100644 --- a/base_pack/totp/version.h +++ b/base_pack/totp/version.h @@ -1,5 +1,5 @@ #pragma once #define TOTP_APP_VERSION_MAJOR (5) -#define TOTP_APP_VERSION_MINOR (10) +#define TOTP_APP_VERSION_MINOR (11) #define TOTP_APP_VERSION_PATCH (0) \ No newline at end of file