Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Nested GeoPoint gets saved as object in Firestore on iOS #947
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Oct 9, 2018
1 parent f95aeb9 commit f41d9e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
[Firebase iOS SDK Changelog](https://firebase.google.com/support/release-notes/ios)
[Firebase Android SDK Changelog](https://firebase.google.com/support/release-notes/android)

## 7.1.4 (2018, October 9)
[Fixes & Enhancements](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/milestone/76?closed=1)


## 7.1.3 (2018, October 8)
[Fixes & Enhancements](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/milestone/75?closed=1)

Expand Down
5 changes: 3 additions & 2 deletions src/firebase.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1810,6 +1810,7 @@ function fixSpecialFields(item) {
item[k] = fixSpecialField(item[k]);
}
}
return item;
}

function fixSpecialField(item): any {
Expand All @@ -1818,8 +1819,6 @@ function fixSpecialField(item): any {
} else if (item instanceof FieldValue) {
const fieldValue: FieldValue = item;
if (fieldValue.type === "ARRAY_UNION") {
console.log(">> fieldValue.value1: " + fieldValue.value);
console.log(">> fieldValue.value2: " + JSON.stringify(fieldValue.value));
return FIRFieldValue.fieldValueForArrayUnion(fieldValue.value);
} else if (fieldValue.type === "ARRAY_REMOVE") {
return FIRFieldValue.fieldValueForArrayRemove(fieldValue.value);
Expand All @@ -1834,6 +1833,8 @@ function fixSpecialField(item): any {
});
} else if (isDocumentReference(item)) {
return item.ios;
} else if (typeof item === "object") {
return fixSpecialFields(item);
} else {
return item;
}
Expand Down

0 comments on commit f41d9e7

Please sign in to comment.