From 5c3b5ede4e6ceb48193c597645db9deb87e3724b Mon Sep 17 00:00:00 2001 From: simoleo89 Date: Sat, 6 Jun 2026 14:32:42 +0200 Subject: [PATCH] fix(furni-editor): disable furnidata Save unless name/desc changed Saving an unchanged name made the server writer return false, which the handler misreports as 'Classname not found in furnidata'. Gate the 'Save name/desc' button on a real diff (furnidataDirty) so an unchanged save can no longer fire that misleading error. --- .../furni-editor/views/FurniEditorEditView.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/furni-editor/views/FurniEditorEditView.tsx b/src/components/furni-editor/views/FurniEditorEditView.tsx index 636afd2..97b7542 100644 --- a/src/components/furni-editor/views/FurniEditorEditView.tsx +++ b/src/components/furni-editor/views/FurniEditorEditView.tsx @@ -211,6 +211,14 @@ export const FurniEditorEditView: FC = props => return cn ? (cn === itemCn) : true; }, [ furniDataEntry, item ]); + // True only when the name/description actually differ from the stored furnidata + // entry. Used to gate the Save button: saving an unchanged value makes the + // server writer return false, which the handler misreports as "Classname not + // found in furnidata" — so we never let an unchanged save fire. + const furnidataDirty = useMemo(() => + furniName !== String(furniDataEntry?.name ?? '') || furniDescription !== String(furniDataEntry?.description ?? ''), + [ furniName, furniDescription, furniDataEntry ]); + const handleSave = useCallback(() => { if(!isValid) return; @@ -294,7 +302,7 @@ export const FurniEditorEditView: FC = props => { furnidataEditable ? LIVE : NO FURNIDATA } - { furnidataEditable && (furniName !== String(furniDataEntry?.name ?? '') || furniDescription !== String(furniDataEntry?.description ?? '')) && + { furnidataEditable && furnidataDirty && Unsaved } { furnidataEditable ? ( @@ -310,7 +318,7 @@ export const FurniEditorEditView: FC = props => - +