Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Firestore/DocumentEditor/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('with basic root fields', () => {
await act(async () => {
getByText('add').click();
});
expect(onChange).toHaveBeenCalledWith({ hello: 'world', '': '' });
expect(onChange).toHaveBeenCalledWith({ hello: 'world' });
});

it('removes root-fields', () => {
Expand Down
4 changes: 4 additions & 0 deletions src/components/Firestore/DocumentEditor/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ export function denormalize(store: Store, firestore?: Firestore): FirestoreAny {
const field = store.fields[store.uuid];
if (isMapField(field)) {
return field.mapChildren.reduce((acc, curr) => {
if (!curr.name) {
// Skip fields with empty name (not allowed by Firestore SDK anyway).
return acc;
}
acc[curr.name] = denormalize(
{
uuid: curr.valueId,
Expand Down