fix(fluxWizard): clone cached values to avoid cache polution

pull/5852/head
Pavel Zavora 2022-02-02 14:53:32 +01:00
parent 72bea3b854
commit 4671a874bf
1 changed files with 8 additions and 10 deletions

View File

@ -79,11 +79,10 @@ class QueryBuilderFetcher {
this.findKeysQueries[tagIndex] = pendingResult
pendingResult.promise
.then(result => {
this.findKeysCache[cacheKey] = result
})
.catch(() => {})
pendingResult.promise = pendingResult.promise.then(result => {
this.findKeysCache[cacheKey] = [...result]
return result
})
return pendingResult.promise
}
@ -121,11 +120,10 @@ class QueryBuilderFetcher {
this.findValuesQueries[tagIndex] = pendingResult
pendingResult.promise
.then(result => {
this.findValuesCache[cacheKey] = result
})
.catch(() => {})
pendingResult.promise = pendingResult.promise.then(result => {
this.findValuesCache[cacheKey] = [...result]
return result
})
return pendingResult.promise
}