From 0bd8748dca987b407d3fa27d385928d6107a60e6 Mon Sep 17 00:00:00 2001 From: Jordan Reimer Date: Thu, 24 Mar 2022 09:30:19 -0600 Subject: [PATCH] updates instances of overriding computed properties (#14675) --- ui/app/services/auth.js | 11 ++++++++--- ui/app/services/store.js | 10 ++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ui/app/services/auth.js b/ui/app/services/auth.js index 598f754f03..7ee8cf59c9 100644 --- a/ui/app/services/auth.js +++ b/ui/app/services/auth.js @@ -35,9 +35,14 @@ export default Service.extend({ clusterAdapter() { return getOwner(this).lookup('adapter:cluster'); }, - - tokens: computed(function () { - return this.getTokensFromStorage() || []; + // eslint-disable-next-line + tokens: computed({ + get() { + return this._tokens || this.getTokensFromStorage() || []; + }, + set(key, value) { + return (this._tokens = value); + }, }), generateTokenName({ backend, clusterId }, policies) { diff --git a/ui/app/services/store.js b/ui/app/services/store.js index 452679d9e8..bd5c9aed9a 100644 --- a/ui/app/services/store.js +++ b/ui/app/services/store.js @@ -29,8 +29,14 @@ export function keyForCache(query) { export default Store.extend({ // this is a map of map that stores the caches - lazyCaches: computed(function () { - return new Map(); + // eslint-disable-next-line + lazyCaches: computed({ + get() { + return this._lazyCaches || new Map(); + }, + set(key, value) { + return (this._lazyCaches = value); + }, }), setLazyCacheForModel(modelName, key, value) {