fix: Prevent overriding the ring with empty value

Apparently changing it to an enum field introduced a bug when an empty value from revision would overwrite actual value from the item itself.
This commit is contained in:
Jarosław Marek
2021-05-04 21:30:40 +12:00
parent 15feb9bc58
commit c1157a771c
3 changed files with 3 additions and 2 deletions

View File

@@ -141,6 +141,7 @@ const addRevisionToItem = (
let newItem: Item = {
...item,
...revision,
ring: revision.ring ? revision.ring : item.ring, // prevent empty revision ring overriding the one from the item. This one field is special as it's an enum.
body: ignoreEmptyRevisionBody(revision, item),
};