aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Model
diff options
context:
space:
mode:
authorGravatar Sebastian Schmidt <mrschmidt@google.com>2017-12-08 14:01:13 -0800
committerGravatar Sebastian Schmidt <mrschmidt@google.com>2017-12-08 14:02:23 -0800
commit84e7f27a3f1885cfe986b154283bcade52f4408d (patch)
treeeb735c6ed16faad3c7074b434929689b864cbe93 /Firestore/Source/Model
parentbf48b0abc18e098c2579ddd3bcd8694269e2db25 (diff)
Adding default option
Diffstat (limited to 'Firestore/Source/Model')
-rw-r--r--Firestore/Source/Model/FSTFieldValue.h2
-rw-r--r--Firestore/Source/Model/FSTFieldValue.m8
2 files changed, 5 insertions, 5 deletions
diff --git a/Firestore/Source/Model/FSTFieldValue.h b/Firestore/Source/Model/FSTFieldValue.h
index 991fb67..fe15865 100644
--- a/Firestore/Source/Model/FSTFieldValue.h
+++ b/Firestore/Source/Model/FSTFieldValue.h
@@ -44,9 +44,9 @@ typedef NS_ENUM(NSInteger, FSTTypeOrder) {
/** Defines the return value for pending server timestamps. */
typedef NS_ENUM(NSInteger, FSTServerTimestampBehavior) {
- FSTServerTimestampBehaviorDefault,
FSTServerTimestampBehaviorEstimate,
FSTServerTimestampBehaviorPrevious,
+ FSTServerTimestampBehaviorNone
};
/** Holds properties that define field value deserialization options. */
diff --git a/Firestore/Source/Model/FSTFieldValue.m b/Firestore/Source/Model/FSTFieldValue.m
index e26bc28..a6326a7 100644
--- a/Firestore/Source/Model/FSTFieldValue.m
+++ b/Firestore/Source/Model/FSTFieldValue.m
@@ -33,13 +33,13 @@ NS_ASSUME_NONNULL_BEGIN
@implementation FSTFieldValueOptions
+ (instancetype)optionsForSnapshotOptions:(FIRSnapshotOptions *)options {
- if (options.serverTimestampBehavior == FSTServerTimestampBehaviorDefault) {
+ if (options.serverTimestampBehavior == FSTServerTimestampBehaviorNone) {
static FSTFieldValueOptions *defaultInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
defaultInstance = [[FSTFieldValueOptions alloc]
- initWithServerTimestampBehavior:FSTServerTimestampBehaviorDefault];
+ initWithServerTimestampBehavior:FSTServerTimestampBehaviorNone];
});
return defaultInstance;
} else {
@@ -74,7 +74,7 @@ NS_ASSUME_NONNULL_BEGIN
- (id)value {
return [self valueWithOptions:[FSTFieldValueOptions
- optionsForSnapshotOptions:[FIRSnapshotOptions defaultOptions]]];
+ optionsForSnapshotOptions:[FIRSnapshotOptions defaultOptions]]];
}
- (id)valueWithOptions:(FSTFieldValueOptions *)options {
@@ -470,7 +470,7 @@ NS_ASSUME_NONNULL_BEGIN
- (id)valueWithOptions:(FSTFieldValueOptions *)options {
switch (options.serverTimestampBehavior) {
- case FSTServerTimestampBehaviorDefault:
+ case FSTServerTimestampBehaviorNone:
return [NSNull null];
case FSTServerTimestampBehaviorEstimate:
return [self.localWriteTime approximateDateValue];