the global confid variable is only there
so we could reuse the name

so i'd prefer we remove that
and use 'let confid' in the relevant blocks
(with var this would have failed)

On 2/1/21 3:21 PM, Aaron Lauterer wrote:
`confid` is overwritten in each step anyways, so it should be no
problem to use it in the outer scope.

Let's play it safe for `sm` and rename it in the function.

Signed-off-by: Aaron Lauterer <a.laute...@proxmox.com>
---

Not sure if my solutions are okay or if another approach is preferable.
Didn't find any patches in the manager repo that deal with the
`no-shadow` rule as a guide though.

  www/manager6/qemu/HardwareView.js | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/www/manager6/qemu/HardwareView.js 
b/www/manager6/qemu/HardwareView.js
index cc707a2a..213a946f 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -220,7 +220,7 @@ Ext.define('PVE.qemu.HardwareView', {
        };
PVE.Utils.forEachBus(undefined, function(type, id) {
-           var confid = type + id;
+           confid = type + id;
            rows[confid] = {
                group: 10,
                iconCls: 'hdd-o',
@@ -531,8 +531,8 @@ Ext.define('PVE.qemu.HardwareView', {
        let isAtLimit = (type) => counts[type] >= 
PVE.Utils.hardware_counts[type];
var set_button_status = function() {
-           var sm = me.getSelectionModel();
-           var rec = sm.getSelection()[0];
+           var selection_model = me.getSelectionModel();
+           var rec = selection_model.getSelection()[0];
// en/disable hardwarebuttons
            counts = {};



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to