From d76556185c565f079568b7df53674f7ce0a87c7b Mon Sep 17 00:00:00 2001 From: oneRain Date: Fri, 7 May 2021 16:27:04 +0800 Subject: [PATCH] fix: object merge CreatedAt/UpdatedAt --- Storage/Storage/Public/LCObject.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Storage/Storage/Public/LCObject.cs b/Storage/Storage/Public/LCObject.cs index 38d5e9c..62868ea 100644 --- a/Storage/Storage/Public/LCObject.cs +++ b/Storage/Storage/Public/LCObject.cs @@ -572,8 +572,8 @@ namespace LeanCloud.Storage { public void Merge(LCObjectData objectData) { data.ClassName = objectData.ClassName ?? data.ClassName; data.ObjectId = objectData.ObjectId ?? data.ObjectId; - data.CreatedAt = objectData.CreatedAt != null ? objectData.CreatedAt : data.CreatedAt; - data.UpdatedAt = objectData.UpdatedAt != null ? objectData.UpdatedAt : data.UpdatedAt; + data.CreatedAt = !objectData.CreatedAt.Equals(default) ? objectData.CreatedAt : data.CreatedAt; + data.UpdatedAt = !objectData.UpdatedAt.Equals(default) ? objectData.UpdatedAt : data.UpdatedAt; // 先将本地的预估数据直接替换 data.CustomPropertyDict = estimatedData; // 再将服务端的数据覆盖