Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

refresh assets after deletion

Oleg Isonen9dfcdad0dbaf
diff --git a/apps/designer/app/designer/shared/assets/use-assets.ts b/apps/designer/app/designer/shared/assets/use-assets.ts
index 265cad7907..a6b3488b1d 100644
--- a/apps/designer/app/designer/shared/assets/use-assets.ts
+++ b/apps/designer/app/designer/shared/assets/use-assets.ts
@@ -123,11 +123,16 @@ export const useAssets = (type: AssetType) => {
}, [data, setAssets]);
const handleDelete = (ids: Array<string>) => {
+ if (action === undefined) {
+ return;
+ }
const formData = new FormData();
for (const id of ids) {
formData.append("assetId", id);
}
- submit(formData, { method: "delete", action });
+ submit(formData, { method: "delete", action }, () => {
+ load(action);
+ });
};
const handleSubmit = (input: HTMLInputElement) => {