chore: Fix more lint

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-05-19 14:58:27 -04:00
1 parent dfa4629e34
commit b79412fa16
1 file changed
+4 -3
@@ -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);