Skip to content

Commit 60ca64c

Browse files
committed
Fix omitting values in Annotation
We needed it only because of confusion between `text: string` for `Text` tag and `text: string[]` for `TextArea` tag. We don't need to omit other values.
1 parent 80b1f89 commit 60ca64c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

web/libs/editor/src/stores/Annotation/Annotation.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,13 @@ const hotkeys = Hotkey("Annotations", "Annotations");
8181
* @returns {Object} new object without value fields
8282
*/
8383
function omitValueFields(value) {
84-
const newValue = { ...value };
84+
// @todo describe that we only omit `text` from TextArea
85+
if (Array.isArray(value.text)) {
86+
const { text: _, ...newValue } = value;
87+
return newValue;
88+
}
8589

86-
Result.properties.value.propertyNames.forEach((propName) => {
87-
delete newValue[propName];
88-
});
89-
return newValue;
90+
return value;
9091
}
9192

9293
const TrackedState = types.model("TrackedState", {

0 commit comments

Comments
 (0)