mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
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:
@@ -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');
|
||||||
|
|||||||
Reference in New Issue
Block a user