@@ -54,28 +54,18 @@ void totp_cli_command_move_handle(PluginState* plugin_state, FuriString* args, C
54
54
activate_generate_token_scene = true;
55
55
}
56
56
57
- bool token_updated = false;
58
57
TokenInfo * token_info = NULL ;
59
- if (new_token_index > 0 ) {
60
- plugin_state -> tokens_list =
61
- list_remove_at (plugin_state -> tokens_list , token_index - 1 , (void * * )& token_info );
62
- furi_check (token_info != NULL );
63
- plugin_state -> tokens_list =
64
- list_insert_at (plugin_state -> tokens_list , new_token_index - 1 , token_info );
65
- token_updated = true;
66
- } else {
67
- token_info = list_element_at (plugin_state -> tokens_list , token_index - 1 )-> data ;
68
- }
58
+ plugin_state -> tokens_list =
59
+ list_remove_at (plugin_state -> tokens_list , token_index - 1 , (void * * )& token_info );
60
+ furi_check (token_info != NULL );
61
+ plugin_state -> tokens_list =
62
+ list_insert_at (plugin_state -> tokens_list , new_token_index - 1 , token_info );
69
63
70
- if (token_updated ) {
71
- if (totp_full_save_config_file (plugin_state ) == TotpConfigFileUpdateSuccess ) {
72
- TOTP_CLI_PRINTF_SUCCESS (
73
- "Token \"%s\" has been successfully updated\r\n" , token_info -> name );
74
- } else {
75
- TOTP_CLI_PRINT_ERROR_UPDATING_CONFIG_FILE ();
76
- }
64
+ if (totp_full_save_config_file (plugin_state ) == TotpConfigFileUpdateSuccess ) {
65
+ TOTP_CLI_PRINTF_SUCCESS (
66
+ "Token \"%s\" has been successfully updated\r\n" , token_info -> name );
77
67
} else {
78
- TOTP_CLI_PRINT_INVALID_ARGUMENTS ();
68
+ TOTP_CLI_PRINT_ERROR_UPDATING_CONFIG_FILE ();
79
69
}
80
70
81
71
if (activate_generate_token_scene ) {
0 commit comments