1
0
mirror of https://github.com/lensapp/lens.git synced 2024-09-11 09:25:26 +03:00

chore: Fix more lint

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2023-05-12 15:02:29 -04:00 committed by Gabriel Accettola
parent 747f8cec94
commit 83244ceefc

View File

@ -9,14 +9,15 @@ import type { HotbarData } from "../common/hotbar";
import type { HotbarItem } from "../common/types";
import v640HotbarStoreMigrationInjectable from "./welcome-page-migration.injectable";
import { defaultHotbarCells } from "../common/types";
import { array } from "@k8slens/utilities";
function fillWithEmpties(items: HotbarItem[]) {
const emptyHotBarItems = new Array(defaultHotbarCells).fill(null);
function fillWithEmpties(items: (HotbarItem | null)[]) {
const emptyHotBarItems = array.filled(defaultHotbarCells, null);
return [...items, ...emptyHotBarItems.slice(items.length)];
}
function setFirstHotbarItems(store: MigrationStore, items: HotbarItem[]) {
function setFirstHotbarItems(store: MigrationStore, items: (HotbarItem | null)[]) {
const oldHotbars = store.get("hotbars") as HotbarData[];
// empty hotbar items are nulls
const itemsWithEmptyCells = fillWithEmpties(items);