refactor: remove unneeded divider in storage class action menu (#460)

Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
Andy Lee 2025-08-15 10:51:13 +08:00 committed by GitHub
parent c289b001db
commit 76605fdc07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -94,13 +94,14 @@ export default class HciStorageClass extends StorageClass {
get availableActions() {
let out = super.availableActions || [];
out = out.map((action) => {
if ((action.action === 'setDefault' || action.action === 'setAsDefault' || action.action === 'promptRemove') && this.isInternalStorageClass()) {
return { ...action, enabled: false };
}
return action;
});
if (this.isInternalStorageClass()) {
out = out.filter((action) => {
return !['setDefault', 'setAsDefault', 'promptRemove'].includes(action.action);
});
}
if (out[0] && out[0].divider === true) {
out = out.slice(1);
}
return out;
}