Fixes following review

- Ensure that the correct threshold if fetched from config (was previously always enabled)
- Don't pass additional `namespace` value to `loadDataPage`
This commit is contained in:
Richard Cox 2022-11-04 16:51:00 +00:00
parent 75aa51fab9
commit e448505b3c
2 changed files with 6 additions and 9 deletions

View File

@ -45,7 +45,7 @@ export default {
// force ns filtering
forceNsFilter: {
...perfConfig.forceNsFilter,
threshold: parseInt(this.perfConfig?.incrementalLoading?.threshold || '0', 10)
threshold: parseInt(perfConfig?.forceNsFilter?.threshold || '0', 10)
}
};
},

View File

@ -80,7 +80,7 @@ export default {
// Load a page of data for a given type
// Used for incremental loading when enabled
async loadDataPage(ctx, { type, opt, namespace }) {
async loadDataPage(ctx, { type, opt }) {
const { getters, commit, dispatch } = ctx;
type = getters.normalizeType(type);
@ -110,16 +110,15 @@ export default {
opt: {
...opt,
url: res.pagination?.next
},
namespace
}
});
} else {
// We have everything!
if (opt.hasManualRefresh) {
dispatch('resource-fetch/updateManualRefreshIsLoading', false, { root: true });
}
if (namespace) {
commit('setHaveNamespace', { type, namespace });
if (opt.namespaced) {
commit('setHaveNamespace', { type, namespace: opt.namespaced });
} else {
commit('setHaveAll', { type });
}
@ -213,9 +212,7 @@ export default {
commit('forgetType', type);
}
dispatch('loadDataPage', {
type, opt: pageFetchOpts, namespace: opt.namespaced
});
dispatch('loadDataPage', { type, opt: pageFetchOpts });
}
let streamStarted = false;