mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Archive fix unpinning last item
This commit is contained in:
@@ -112,7 +112,9 @@ static bool archive_favourites_rescan() {
|
||||
furi_string_free(buffer);
|
||||
|
||||
storage_file_close(file);
|
||||
storage_common_move(storage, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH);
|
||||
if(storage_common_move(storage, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH) == FSE_NOT_EXIST) {
|
||||
storage_common_remove(storage, ARCHIVE_FAV_PATH);
|
||||
}
|
||||
|
||||
storage_file_free(file);
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
@@ -215,7 +217,9 @@ bool archive_favorites_delete(const char* format, ...) {
|
||||
furi_string_free(filename);
|
||||
|
||||
storage_file_close(file);
|
||||
storage_common_move(fs_api, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH);
|
||||
if(storage_common_move(fs_api, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH) == FSE_NOT_EXIST) {
|
||||
storage_common_remove(fs_api, ARCHIVE_FAV_PATH);
|
||||
}
|
||||
|
||||
storage_file_free(file);
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
@@ -298,7 +302,9 @@ bool archive_favorites_rename(const char* src, const char* dst) {
|
||||
furi_string_free(path);
|
||||
|
||||
storage_file_close(file);
|
||||
storage_common_move(fs_api, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH);
|
||||
if(storage_common_move(fs_api, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH) == FSE_NOT_EXIST) {
|
||||
storage_common_remove(fs_api, ARCHIVE_FAV_PATH);
|
||||
}
|
||||
|
||||
storage_file_free(file);
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
@@ -324,7 +330,9 @@ void archive_favorites_save(void* context) {
|
||||
archive_file_append(ARCHIVE_FAV_TEMP_PATH, "%s\n", furi_string_get_cstr(item->path));
|
||||
}
|
||||
|
||||
storage_common_move(fs_api, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH);
|
||||
if(storage_common_move(fs_api, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH) == FSE_NOT_EXIST) {
|
||||
storage_common_remove(fs_api, ARCHIVE_FAV_PATH);
|
||||
}
|
||||
|
||||
storage_file_free(file);
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
|
||||
Reference in New Issue
Block a user