aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Model/FSTFieldValue.mm
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-04-16 13:50:11 -0700
committerGravatar GitHub <noreply@github.com>2018-04-16 13:50:11 -0700
commita25d05487435d397f3b8cd399ee8355eae497f0d (patch)
tree323b23f9ad4849093f2dbb53c8ebece59f0bd870 /Firestore/Source/Model/FSTFieldValue.mm
parent0ac71f294ffedc8c6a3fb93e18253ee25624ec00 (diff)
Replace the `SnapshotOptions` object with the behavior enum. (#1109)
Instead of calling `get(field, SnapshotOptions.serverTimestampBehavior(.estimate))` call `get(field, serverTimestampBehavior: .estimate)`
Diffstat (limited to 'Firestore/Source/Model/FSTFieldValue.mm')
-rw-r--r--Firestore/Source/Model/FSTFieldValue.mm24
1 files changed, 1 insertions, 23 deletions
diff --git a/Firestore/Source/Model/FSTFieldValue.mm b/Firestore/Source/Model/FSTFieldValue.mm
index 0d7c649..9e77d39 100644
--- a/Firestore/Source/Model/FSTFieldValue.mm
+++ b/Firestore/Source/Model/FSTFieldValue.mm
@@ -16,10 +16,10 @@
#import "Firestore/Source/Model/FSTFieldValue.h"
+#import "FIRDocumentSnapshot.h"
#import "FIRTimestamp.h"
#import "Firestore/Source/API/FIRGeoPoint+Internal.h"
-#import "Firestore/Source/API/FIRSnapshotOptions+Internal.h"
#import "Firestore/Source/Model/FSTDocumentKey.h"
#import "Firestore/Source/Util/FSTAssert.h"
#import "Firestore/Source/Util/FSTClasses.h"
@@ -46,28 +46,6 @@ NS_ASSUME_NONNULL_BEGIN
@implementation FSTFieldValueOptions
-+ (instancetype)optionsForSnapshotOptions:(FIRSnapshotOptions *)options
- timestampsInSnapshotsEnabled:(BOOL)timestampsInSnapshotsEnabled {
- FSTServerTimestampBehavior convertedServerTimestampBehavior = FSTServerTimestampBehaviorNone;
- switch (options.serverTimestampBehavior) {
- case FIRServerTimestampBehaviorNone:
- convertedServerTimestampBehavior = FSTServerTimestampBehaviorNone;
- break;
- case FIRServerTimestampBehaviorEstimate:
- convertedServerTimestampBehavior = FSTServerTimestampBehaviorEstimate;
- break;
- case FIRServerTimestampBehaviorPrevious:
- convertedServerTimestampBehavior = FSTServerTimestampBehaviorPrevious;
- break;
- default:
- FSTFail(@"Unexpected server timestamp option: %ld", (long)options.serverTimestampBehavior);
- }
-
- return
- [[FSTFieldValueOptions alloc] initWithServerTimestampBehavior:convertedServerTimestampBehavior
- timestampsInSnapshotsEnabled:timestampsInSnapshotsEnabled];
-}
-
- (instancetype)initWithServerTimestampBehavior:(FSTServerTimestampBehavior)serverTimestampBehavior
timestampsInSnapshotsEnabled:(BOOL)timestampsInSnapshotsEnabled {
self = [super init];