fix(furni-editor): surface upsert failures and revert optimistic name on error

When creating a furnidata entry for a furni whose sprite id is already used
by another classname, the server rejects with ID_COLLISION. The client showed
the optimistic public-name change but never reverted it, so a failed create
looked like it had succeeded. On any FurniEditorResult failure, re-fetch the
item detail to restore the true state (the error alert was already shown).
This commit is contained in:
simoleo89
2026-06-14 14:44:25 +02:00
parent 74cbeccb52
commit 1676b3c871
+9
View File
@@ -190,6 +190,15 @@ export const useFurniEditor = () =>
{ {
setError(parser.message || 'Operation failed'); setError(parser.message || 'Operation failed');
// updateFurnidata applies an optimistic publicName change before the
// server replies. On failure (e.g. a sprite-id collision when creating
// an entry for a variant furni) re-fetch the detail so the UI reverts
// to the true state instead of showing the name that was never applied.
if(actionItemId)
{
SendMessageComposer(new FurniEditorDetailComposer(actionItemId));
}
if(simpleAlert) if(simpleAlert)
{ {
simpleAlert(parser.message || 'Operation failed', NotificationAlertType.ALERT, null, null, 'Furni Editor Error'); simpleAlert(parser.message || 'Operation failed', NotificationAlertType.ALERT, null, null, 'Furni Editor Error');