[FL-2961] SubGhz: properly handle storage loss (#1990)
Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -490,6 +490,23 @@ bool subghz_rename_file(SubGhz* subghz) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool subghz_file_available(SubGhz* subghz) {
|
||||
furi_assert(subghz);
|
||||
bool ret = true;
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
|
||||
FS_Error fs_result =
|
||||
storage_common_stat(storage, furi_string_get_cstr(subghz->file_path), NULL);
|
||||
|
||||
if(fs_result != FSE_OK) {
|
||||
dialog_message_show_storage_error(subghz->dialogs, "File not available\n file/directory");
|
||||
ret = false;
|
||||
}
|
||||
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool subghz_delete_file(SubGhz* subghz) {
|
||||
furi_assert(subghz);
|
||||
|
||||
|
Reference in New Issue
Block a user