Skip to content

Commit

Permalink
update totp
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Aug 16, 2023
1 parent 020928c commit 58440b2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ App(
],
stack_size=2 * 1024,
order=20,
fap_version="4.01",
fap_version="4.02",
fap_author="Alexander Kopachov (@akopachov)",
fap_description="Software-based TOTP authenticator for Flipper Zero device",
fap_weburl="https://github.com/akopachov/flipper-zero_authenticator",
Expand Down
11 changes: 11 additions & 0 deletions services/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion ui/scenes/generate_token/totp_scene_generate_token.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 58440b2

Please sign in to comment.