From 23d01f0b3496f3b28741b6993e892e76aa73302d Mon Sep 17 00:00:00 2001 From: DrJKL Date: Mon, 1 Dec 2025 13:24:24 -0800 Subject: [PATCH] UX: Handle failed update --- src/platform/assets/components/AssetCard.vue | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/platform/assets/components/AssetCard.vue b/src/platform/assets/components/AssetCard.vue index 222a186f3..f12ed5490 100644 --- a/src/platform/assets/components/AssetCard.vue +++ b/src/platform/assets/components/AssetCard.vue @@ -226,11 +226,16 @@ async function assetRename(newName?: string) { if (newName) { // Optimistic update newNameRef.value = newName - const result = await assetService.updateAsset(asset.id, { - name: newName - }) - // Update with the actual name once the server responds - newNameRef.value = result.name + try { + const result = await assetService.updateAsset(asset.id, { + name: newName + }) + // Update with the actual name once the server responds + newNameRef.value = result.name + } catch (err: unknown) { + console.error(err) + newNameRef.value = undefined + } } }