mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 06:19:58 +00:00
UX: Handle failed update
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user