fix(mobile): asset state remain in gallery view after being deleted (#10603)

* fix(mobile): asset doesn't get removed from state renderList

* fix delete last assets

* refactor
This commit is contained in:
Alex
2024-06-26 21:15:26 -07:00
committed by GitHub
parent 922430da36
commit d8175d8da8
8 changed files with 158 additions and 140 deletions

View File

@@ -311,4 +311,12 @@ class RenderList {
GroupAssetsBy groupBy,
) =>
_buildRenderList(assets, null, groupBy);
/// Deletes an asset from the render list and clears the buffer
/// This is only a workaround for deleted images still appearing in the gallery
void deleteAsset(Asset deleteAsset) {
allAssets?.remove(deleteAsset);
_buf.clear();
_bufOffset = 0;
}
}