prevent display icon if this.volumes is empty array

Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit c75755a52710ff78276fc35f46af30a38b73cac8)
This commit is contained in:
andy.lee 2025-02-05 14:06:12 +08:00 committed by Mergify
parent adacaf65fa
commit e7446e7e23

View File

@ -640,6 +640,10 @@ export default class VirtVm extends HarvesterResource {
} }
get encryptedVolumeType() { get encryptedVolumeType() {
if (!this.volumes || this.volumes.length === 0) {
return 'none';
}
if (this.volumes.every((vol) => vol.isEncrypted)) { if (this.volumes.every((vol) => vol.isEncrypted)) {
return 'all'; return 'all';
} else if (this.volumes.some((vol) => vol.isEncrypted)) { } else if (this.volumes.some((vol) => vol.isEncrypted)) {