if we have a value that is set to `0` (the number, not the string),
the default pending object grid renderer would overwrite that with the
empty string, since `0` does not evaluate to true.

Instead, use the `Nullish coalescing operator` (??) to overwrite the
value with only when it's null or undefined.

This fixes an issue with the rendering if the `TTY Count` in PVE is set
to 0. (There are no other options where this could happen currently,
because they either have a custom renderer, or do not allow 0 as value).

Reported-by: Dietmar Maurer <[email protected]>
Suggested-by: Thomas Lamprecht <[email protected]>
Signed-off-by: Dominik Csapak <[email protected]>
---
this replaces the first half of this patch:
https://lore.proxmox.com/pve-devel/[email protected]/

 src/grid/PendingObjectGrid.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/grid/PendingObjectGrid.js b/src/grid/PendingObjectGrid.js
index 6898717..c138713 100644
--- a/src/grid/PendingObjectGrid.js
+++ b/src/grid/PendingObjectGrid.js
@@ -74,7 +74,7 @@ Ext.define('Proxmox.grid.PendingObjectGrid', {
                 pending = undefined;
             }
         } else {
-            current = value || '';
+            current = value ?? '';
             pending = record.data.pending;
         }
 
-- 
2.47.3



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to