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:
parent
c1b28159b2
commit
a4f5c35ead
1 changed files with 5 additions and 0 deletions
|
|
@ -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" />
|
||||
|
|
|
|||
Loading…
Reference in a new issue