diff --git a/CHANGELOG.md b/CHANGELOG.md index bfd715a..ae8dc8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### Version: 2.20.0 +#### Date: Dec-19-2024 + +##### Fix: +- Reset `LivePreviewConfig` to prevent overwriting fetched data with live preview data during regular fetch calls. + ### Version: 2.19.0 #### Date: Nov-30-2024 diff --git a/Contentstack.Core/ContentstackClient.cs b/Contentstack.Core/ContentstackClient.cs index 8734681..b86d2f4 100644 --- a/Contentstack.Core/ContentstackClient.cs +++ b/Contentstack.Core/ContentstackClient.cs @@ -555,6 +555,10 @@ public void SetHeader(string key, string value) /// public async Task LivePreviewQueryAsync(Dictionary query) { + this.LivePreviewConfig.LivePreview = null; + this.LivePreviewConfig.ContentTypeUID = null; + this.LivePreviewConfig.EntryUID = null; + if (query.Keys.Contains("content_type_uid")) { string contentTypeUID = null; @@ -572,8 +576,6 @@ public async Task LivePreviewQueryAsync(Dictionary query) string hash = null; query.TryGetValue("live_preview", out hash); this.LivePreviewConfig.LivePreview = hash; - } else { - this.LivePreviewConfig.LivePreview = "init"; } this.LivePreviewConfig.PreviewResponse = await GetLivePreviewData(); } diff --git a/Contentstack.Core/Internals/HttpRequestHandler.cs b/Contentstack.Core/Internals/HttpRequestHandler.cs index c6eff08..6252f51 100644 --- a/Contentstack.Core/Internals/HttpRequestHandler.cs +++ b/Contentstack.Core/Internals/HttpRequestHandler.cs @@ -48,7 +48,7 @@ public async Task ProcessRequest(string Url, Dictionary var request = (HttpWebRequest)WebRequest.Create(uri); request.Method = "GET"; request.ContentType = "application/json"; - request.Headers["x-user-agent"]="contentstack-delivery-dotnet/2.19.0"; + request.Headers["x-user-agent"]="contentstack-delivery-dotnet/2.20.0"; request.Timeout = timeout; if (proxy != null) diff --git a/Directory.Build.props b/Directory.Build.props index f4c6c0f..2beb17e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,5 @@ - 2.19.0 + 2.20.0