Skip to content

Commit

Permalink
Address lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac committed Mar 28, 2024
1 parent 37206f9 commit c06c394
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion shell/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export const getters = {
// falls back to the explorer product and then the first active product.
currentProduct(state, getters) {
let product = state.productId || EXPLORER;
let cache = {};
const cache = {};

// Rather than determining all active products, just check the current product (more performant)
let res = getters['type-map/isProductActive'](product, cache);
Expand Down
15 changes: 8 additions & 7 deletions shell/store/type-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ export const getters = {

/**
* Returns a getter for testing if the specific product is active
*
*
* A cache object can be passed in, so if you need to call this multiple times, the cache
* can be re-used to avoid having to enumerate schemas to calculate knownTypes and groups
* if required
Expand All @@ -1369,12 +1369,12 @@ export const getters = {
// Return a named function so that we can trace it in the browser performance log
return function isProductActive(productOrId, previousCache) {
// Use the supplied cache object if there is one, otherwise a new local object
let cache = previousCache || {};
const cache = previousCache || {};

if (!cache.knownTypes) {
cache.knownTypes = {};
}

if (!cache.knownGroups) {
cache.knownGroups = {};
}
Expand All @@ -1388,6 +1388,7 @@ export const getters = {
}

const module = p.inStore;
const isDev = rootGetters['prefs/get'](VIEW_IN_API);

if ( !p.public && !isDev ) {
return false;
Expand Down Expand Up @@ -1427,7 +1428,7 @@ export const getters = {
}

if (p.ifHave && !ifHave(rootGetters, p.ifHave)) {
return false;
return false;
}

if (p.ifHaveType) {
Expand Down Expand Up @@ -1458,7 +1459,7 @@ export const getters = {
return;
}

let cache = {};
const cache = {};

return state.products.filter((p) => getters['isProductActive'](p, cache));
},
Expand All @@ -1470,7 +1471,7 @@ export const getters = {
return;
}

let cache = {};
const cache = {};

return state.products.filter((p) => !p.rootProduct || p.rootProduct === p.name).filter((p) => getters['isProductActive'](p, cache));
},
Expand Down

0 comments on commit c06c394

Please sign in to comment.