Skip to content

Commit

Permalink
Fix issue where no filter options are shown on refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed May 12, 2023
1 parent a5fcd20 commit fa94ebd
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions shell/components/nav/NamespaceFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ export default {
}
});
richardsLogger.warn('ns filter component', 'filtered', 10, out)
return out;
},
Expand Down Expand Up @@ -280,6 +282,8 @@ export default {
addNamespace(out, namespaces);
}
// richardsLogger.warn('ns filter component', 'options', 10,out)
return out;
function addNamespace(out, namespaces) {
Expand Down Expand Up @@ -314,7 +318,7 @@ export default {
value: {
get() {
richardsLogger.warn('ns filter component', 'value', 'get')
// richardsLogger.warn('ns filter component', 'value', 'get')
// Use last picked filter from user preferences
const prefs = this.$store.getters['prefs/get'](NAMESPACE_FILTERS);
Expand All @@ -332,7 +336,7 @@ export default {
},
set(neu) {
richardsLogger.warn('ns filter component', 'value', 'set', neu)
// richardsLogger.warn('ns filter component', 'value', 'set', neu)
const old = (this.value || []).slice();
neu = neu.filter(x => !!x.id);
Expand Down Expand Up @@ -396,9 +400,15 @@ export default {
* To break this multiple-render per cycle behaviour detatch `filtered` from the value used in `v-for`.
*
*/
filtered(neu) {
if (!!neu) {
this.cachedFiltered = neu;
filtered: {
immediate: true,
handler(neu) {
// richardsLogger.warn('ns filter component', 'watch', 'filtered', 1)
if (!!neu) {
// richardsLogger.warn('ns filter component', 'watch', 'filtered', neu)
this.cachedFiltered = neu;
}
}
}
},
Expand Down

0 comments on commit fa94ebd

Please sign in to comment.