From 4206d6fadb7df9d200d69692b76a621a744dc79b Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 29 Sep 2023 15:39:23 +0200 Subject: [PATCH] ui: tape: restore: improve variable names some of the variable names did not really tell the full story, so extend them a bit. This makes the intention much clearer. Signed-off-by: Dominik Csapak Tested-by: Mira Limbeck --- www/tape/window/TapeRestore.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/www/tape/window/TapeRestore.js b/www/tape/window/TapeRestore.js index 988ceba2..f350fd76 100644 --- a/www/tape/window/TapeRestore.js +++ b/www/tape/window/TapeRestore.js @@ -723,7 +723,7 @@ Ext.define('PBS.TapeManagement.SnapshotGrid', { let me = this; let snapshots = []; - let storeCounts = {}; + let selectedStoreCounts = {}; me.getSelection().forEach((rec) => { let id = rec.get('id'); @@ -732,10 +732,10 @@ Ext.define('PBS.TapeManagement.SnapshotGrid', { // only add if not filtered if (me.store.findExact('id', id) !== -1) { snapshots.push(`${store}:${snap}`); - if (storeCounts[store] === undefined) { - storeCounts[store] = 0; + if (selectedStoreCounts[store] === undefined) { + selectedStoreCounts[store] = 0; } - storeCounts[store]++; + selectedStoreCounts[store]++; } }); @@ -747,17 +747,17 @@ Ext.define('PBS.TapeManagement.SnapshotGrid', { } let wholeStores = []; - let wholeStoresSelected = true; - for (const [store, count] of Object.entries(storeCounts)) { - if (me.storeCounts[store] === count) { + let onlyWholeStoresSelected = true; + for (const [store, selectedCount] of Object.entries(selectedStoreCounts)) { + if (me.storeCounts[store] === selectedCount) { wholeStores.push(store); } else { - wholeStoresSelected = false; + onlyWholeStoresSelected = false; break; } } - if (wholeStoresSelected) { + if (onlyWholeStoresSelected) { return wholeStores; }