From eb4147b5a9eca6c3a45c7c4b9c041a6af6b8199e Mon Sep 17 00:00:00 2001 From: Liza K Date: Tue, 13 Apr 2021 14:24:34 +0300 Subject: [PATCH] ts --- .../plugins/data_enhanced/public/search/search_interceptor.ts | 2 +- .../data_enhanced/public/search/search_response_cache.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/data_enhanced/public/search/search_interceptor.ts b/x-pack/plugins/data_enhanced/public/search/search_interceptor.ts index 353bb37c7b10..3e7564933a0c 100644 --- a/x-pack/plugins/data_enhanced/public/search/search_interceptor.ts +++ b/x-pack/plugins/data_enhanced/public/search/search_interceptor.ts @@ -132,7 +132,7 @@ export class EnhancedSearchInterceptor extends SearchInterceptor { savedToBackgroundSub.unsubscribe(); } }), - // This observable is cached in the responseCache. + // This observable is cached in the responseCache. // Using shareReplay makes sure that future subscribers will get the final response shareReplay(1) diff --git a/x-pack/plugins/data_enhanced/public/search/search_response_cache.ts b/x-pack/plugins/data_enhanced/public/search/search_response_cache.ts index 3a97a180ffaf..1467e5bf234f 100644 --- a/x-pack/plugins/data_enhanced/public/search/search_response_cache.ts +++ b/x-pack/plugins/data_enhanced/public/search/search_response_cache.ts @@ -100,7 +100,7 @@ export class SearchResponseCache { response$.subscribe({ next: (r) => { // TODO: avoid stringiying. Get the size some other way! - const newSize = (new Blob([JSON.stringify(r)])).size; + const newSize = new Blob([JSON.stringify(r)]).size; if (this.byteToMb(newSize) < this.maxCacheSizeMB && !isErrorResponse(r)) { this.setItem(key, { ...cacheItem,