Skip to content

Commit

Permalink
fix(firestore, web): fix a query error in Flutter Web that was affect…
Browse files Browse the repository at this point in the history
…ing the parsing of ancient dates (#9633)
  • Loading branch information
Lyokone authored Oct 4, 2022
1 parent 39ca002 commit 9250d45
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>11.0</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -435,7 +435,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -484,7 +484,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:cloud_firestore_platform_interface/cloud_firestore_platform_interface.dart';
import 'package:firebase_core_web/firebase_core_web_interop.dart'
as core_interop;
import 'package:js/js.dart';
Expand All @@ -23,8 +24,7 @@ dynamic dartify(Object? jsObject) {
return object;
}
if (util.instanceof(object, TimestampJsConstructor)) {
return DateTime.fromMillisecondsSinceEpoch(
(object as TimestampJsImpl).toMillis());
return Timestamp((object as TimestampJsImpl).seconds, object.nanoseconds);
}
if (util.instanceof(object, BytesConstructor)) {
return object as BytesJsImpl;
Expand All @@ -44,6 +44,10 @@ dynamic jsify(Object? dartObject) {
return TimestampJsImpl.fromMillis(object.millisecondsSinceEpoch);
}

if (object is Timestamp) {
return TimestampJsImpl.fromMillis(object.millisecondsSinceEpoch);
}

if (object is DocumentReference) {
return object.jsObject;
}
Expand Down

0 comments on commit 9250d45

Please sign in to comment.