mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix: don't assign to priority in getItemsForKind (#2611)
This commit is contained in:
parent
476235b861
commit
4d10e07087
@ -35,10 +35,6 @@ export class EntitySettingRegistry extends BaseRegistry<EntitySettingRegistratio
|
||||
getItemsForKind(kind: string, apiVersion: string, source?: string) {
|
||||
let items = this.getItems().filter((item) => {
|
||||
return item.kind === kind && item.apiVersions.includes(apiVersion);
|
||||
}).map((item) => {
|
||||
item.priority = item.priority ?? 50;
|
||||
|
||||
return item;
|
||||
});
|
||||
|
||||
if (source) {
|
||||
@ -47,7 +43,7 @@ export class EntitySettingRegistry extends BaseRegistry<EntitySettingRegistratio
|
||||
});
|
||||
}
|
||||
|
||||
return items.sort((a, b) => b.priority - a.priority);
|
||||
return items.sort((a, b) => (b.priority ?? 50) - (a.priority ?? 50));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -16,15 +16,9 @@ export class KubeObjectDetailRegistry extends BaseRegistry<KubeObjectDetailRegis
|
||||
getItemsForKind(kind: string, apiVersion: string) {
|
||||
const items = this.getItems().filter((item) => {
|
||||
return item.kind === kind && item.apiVersions.includes(apiVersion);
|
||||
}).map((item) => {
|
||||
if (item.priority === null) {
|
||||
item.priority = 50;
|
||||
}
|
||||
|
||||
return item;
|
||||
});
|
||||
|
||||
return items.sort((a, b) => b.priority - a.priority);
|
||||
return items.sort((a, b) => (b.priority ?? 50) - (a.priority ?? 50));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user