From 8f8684990ce9a3186259027985ad707fbf38daa2 Mon Sep 17 00:00:00 2001 From: Alexander Kopachov Date: Wed, 16 Aug 2023 10:36:40 +0200 Subject: [PATCH] Fixed #190 (#191) --- services/config/config.c | 11 +++++++++++ ui/scenes/generate_token/totp_scene_generate_token.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/services/config/config.c b/services/config/config.c index 9320f4507c3..bd2d877b0fb 100644 --- a/services/config/config.c +++ b/services/config/config.c @@ -129,6 +129,17 @@ static bool totp_open_config_file(Storage* storage, FlipperFormat** file) { return false; } } else { + if(storage_common_stat(storage, CONFIG_FILE_DIRECTORY_PATH, NULL) == FSE_NOT_EXIST) { + FURI_LOG_D(LOGGING_TAG, "Config file directory doesn't exist. Will create new"); + if(!storage_simply_mkdir(storage, CONFIG_FILE_DIRECTORY_PATH)) { + FURI_LOG_E( + LOGGING_TAG, + "Error creating config file directory %s", + CONFIG_FILE_DIRECTORY_PATH); + return false; + } + } + FURI_LOG_D(LOGGING_TAG, "Config file %s is not found. Will create new.", CONFIG_FILE_PATH); if(!flipper_format_file_open_new(fff_data_file, CONFIG_FILE_PATH)) { diff --git a/ui/scenes/generate_token/totp_scene_generate_token.c b/ui/scenes/generate_token/totp_scene_generate_token.c index b769d364d75..c0b8414eaea 100644 --- a/ui/scenes/generate_token/totp_scene_generate_token.c +++ b/ui/scenes/generate_token/totp_scene_generate_token.c @@ -245,7 +245,7 @@ void totp_scene_generate_token_render(Canvas* const canvas, PluginState* plugin_ SCREEN_HEIGHT_CENTER + 10, AlignCenter, AlignCenter, - "Press OK button to access menu"); + "Press OK button to open menu"); return; }