fix: refresh assets gallery after deleting an upload

The uploads grid is client-fetched, so an Inertia delete with preserveState left the stale list on screen until a hard refresh.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Paulo Castellano 2026-07-23 11:38:29 -03:00
parent c1b28159b2
commit a4f5c35ead

View file

@ -264,6 +264,10 @@ const handleDelete = (assetId: string) => {
});
};
const onAssetDeleted = async () => {
await loadUploadsFirstPage();
};
const createPostFromAsset = (asset: AssetMedia) => {
router.post(storePost.url(), {
media: [{ id: asset.id, path: asset.path, url: asset.url, type: asset.type, mime_type: asset.mime_type }],
@ -940,6 +944,7 @@ onUnmounted(() => {
:description="trans('assets.delete.description')"
:action="trans('assets.delete.confirm')"
:cancel="trans('assets.delete.cancel')"
@deleted="onAssetDeleted"
/>
<ImagePreviewDialog ref="lightbox" />