From 6fe1809e3d56aa7f30137b5237b944297e65aed3 Mon Sep 17 00:00:00 2001 From: "Hung-Han (Henry) Chen" Date: Tue, 5 Oct 2021 08:26:44 +0300 Subject: [PATCH] Fix typo CatelogEntityOnRunHook > CatalogEntityOnRunHook Signed-off-by: Hung-Han (Henry) Chen --- src/extensions/renderer-api/catalog.ts | 6 +++--- src/renderer/api/catalog-entity-registry.ts | 8 ++++---- src/renderer/components/+catalog/catalog-entity-item.tsx | 4 ++-- src/renderer/components/+catalog/catalog-entity.store.tsx | 4 ++-- src/renderer/components/hotbar/hotbar-menu.tsx | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/extensions/renderer-api/catalog.ts b/src/extensions/renderer-api/catalog.ts index 3da4f6127a..28c98c1be1 100644 --- a/src/extensions/renderer-api/catalog.ts +++ b/src/extensions/renderer-api/catalog.ts @@ -22,7 +22,7 @@ import type { CatalogCategory, CatalogEntity } from "../../common/catalog"; import { catalogEntityRegistry as registry } from "../../renderer/api/catalog-entity-registry"; -import type { CatelogEntityOnRunHook } from "../../renderer/api/catalog-entity-registry"; +import type { CatalogEntityOnRunHook } from "../../renderer/api/catalog-entity-registry"; export { catalogCategoryRegistry as catalogCategories } from "../../common/catalog/catalog-category-registry"; export class CatalogEntityRegistry { @@ -55,14 +55,14 @@ export class CatalogEntityRegistry { * @param onRunHook The function that should return a boolean if the onRun of catalog entity should be triggered. * @returns A function to remove that hook */ - addOnRunHook(catalogEntityUid: CatalogEntity["metadata"]["uid"], onRunHook: CatelogEntityOnRunHook) { + addOnRunHook(catalogEntityUid: CatalogEntity["metadata"]["uid"], onRunHook: CatalogEntityOnRunHook) { return registry.addOnRunHook(catalogEntityUid, onRunHook); } /** * Returns one catalog entity onRun hook by catalog entity uid */ - getOnRunHook(catalogEntityUid: CatalogEntity["metadata"]["uid"]): CatelogEntityOnRunHook | undefined { + getOnRunHook(catalogEntityUid: CatalogEntity["metadata"]["uid"]): CatalogEntityOnRunHook | undefined { return registry.getOnRunHook(catalogEntityUid); } } diff --git a/src/renderer/api/catalog-entity-registry.ts b/src/renderer/api/catalog-entity-registry.ts index 51139e83b0..aa9bd3dce7 100644 --- a/src/renderer/api/catalog-entity-registry.ts +++ b/src/renderer/api/catalog-entity-registry.ts @@ -30,7 +30,7 @@ import { once } from "lodash"; import type { CatalogEntityItem } from "../../renderer/components/+catalog/catalog-entity-item"; export type EntityFilter = (entity: CatalogEntity) => any; -export type CatelogEntityOnRunHook = (entity: CatalogEntity | CatalogEntityItem) => boolean | Promise; +export type CatalogEntityOnRunHook = (entity: CatalogEntity | CatalogEntityItem) => boolean | Promise; type CatalogEntityUid = CatalogEntity["metadata"]["uid"]; @@ -42,7 +42,7 @@ export class CatalogEntityRegistry { }); protected entityOnRunHooks = observable.set<{ catalogEntityUid: CatalogEntityUid; - onRunHook: CatelogEntityOnRunHook + onRunHook: CatalogEntityOnRunHook }>([], { deep: false, }); @@ -186,7 +186,7 @@ export class CatalogEntityRegistry { * @param onRunHook The function that should return a boolean if the onRun of catalog entity should be triggered. * @returns A function to remove that hook */ - addOnRunHook(catalogEntityUid: CatalogEntityUid, onRunHook: CatelogEntityOnRunHook): Disposer { + addOnRunHook(catalogEntityUid: CatalogEntityUid, onRunHook: CatalogEntityOnRunHook): Disposer { this.entityOnRunHooks.add({ catalogEntityUid, onRunHook, @@ -201,7 +201,7 @@ export class CatalogEntityRegistry { /** * Returns one catalog entity onRun hook by catalog entity uid */ - getOnRunHook(_catalogEntityUid: CatalogEntityUid): CatelogEntityOnRunHook | undefined { + getOnRunHook(_catalogEntityUid: CatalogEntityUid): CatalogEntityOnRunHook | undefined { return Array.from(this.entityOnRunHooks).find(({ catalogEntityUid }) => catalogEntityUid === _catalogEntityUid)?.onRunHook; } } diff --git a/src/renderer/components/+catalog/catalog-entity-item.tsx b/src/renderer/components/+catalog/catalog-entity-item.tsx index 486c63ac1b..773b42113f 100644 --- a/src/renderer/components/+catalog/catalog-entity-item.tsx +++ b/src/renderer/components/+catalog/catalog-entity-item.tsx @@ -22,7 +22,7 @@ import styles from "./catalog.module.css"; import React from "react"; import { action, computed } from "mobx"; import type { CatalogEntity, CatalogEntityActionContext } from "../../api/catalog-entity"; -import type { CatelogEntityOnRunHook } from "../../api/catalog-entity-registry"; +import type { CatalogEntityOnRunHook } from "../../api/catalog-entity-registry"; import type { ItemObject } from "../../../common/item.store"; import { Badge } from "../badge"; import { navigation } from "../../navigation"; @@ -104,7 +104,7 @@ export class CatalogEntityItem implements ItemObject { ]; } - onRun(onRunHook: CatelogEntityOnRunHook | undefined, ctx: CatalogEntityActionContext) { + onRun(onRunHook: CatalogEntityOnRunHook | undefined, ctx: CatalogEntityActionContext) { if (!onRunHook) { this.entity.onRun(ctx); diff --git a/src/renderer/components/+catalog/catalog-entity.store.tsx b/src/renderer/components/+catalog/catalog-entity.store.tsx index 381200f2e0..f4e7ae88fc 100644 --- a/src/renderer/components/+catalog/catalog-entity.store.tsx +++ b/src/renderer/components/+catalog/catalog-entity.store.tsx @@ -22,7 +22,7 @@ import { computed, IReactionDisposer, makeObservable, observable, reaction } from "mobx"; import { catalogEntityRegistry } from "../../api/catalog-entity-registry"; import type { CatalogEntity } from "../../api/catalog-entity"; -import type { CatelogEntityOnRunHook } from "../../api/catalog-entity-registry"; +import type { CatalogEntityOnRunHook } from "../../api/catalog-entity-registry"; import { ItemStore } from "../../../common/item.store"; import { CatalogCategory, catalogCategoryRegistry } from "../../../common/catalog"; import { autoBind } from "../../../common/utils"; @@ -50,7 +50,7 @@ export class CatalogEntityStore extends ItemStore e.getId() === this.selectedItemId); } - getCatalogEntityOnRunHook(catalogEntityUid: CatalogEntity["metadata"]["uid"]): CatelogEntityOnRunHook | undefined { + getCatalogEntityOnRunHook(catalogEntityUid: CatalogEntity["metadata"]["uid"]): CatalogEntityOnRunHook | undefined { return catalogEntityRegistry.getOnRunHook(catalogEntityUid); } diff --git a/src/renderer/components/hotbar/hotbar-menu.tsx b/src/renderer/components/hotbar/hotbar-menu.tsx index d2ebf99bd8..70702d0bc5 100644 --- a/src/renderer/components/hotbar/hotbar-menu.tsx +++ b/src/renderer/components/hotbar/hotbar-menu.tsx @@ -26,7 +26,7 @@ import { observer } from "mobx-react"; import { HotbarEntityIcon } from "./hotbar-entity-icon"; import { cssNames, IClassName } from "../../utils"; import { catalogEntityRegistry } from "../../api/catalog-entity-registry"; -import type { CatelogEntityOnRunHook} from "../../api/catalog-entity-registry"; +import type { CatalogEntityOnRunHook} from "../../api/catalog-entity-registry"; import { HotbarStore } from "../../../common/hotbar-store"; import { CatalogEntity, catalogEntityRunContext } from "../../api/catalog-entity"; import { DragDropContext, Draggable, Droppable, DropResult } from "react-beautiful-dnd"; @@ -56,7 +56,7 @@ export class HotbarMenu extends React.Component { return catalogEntityRegistry.getById(item?.entity.uid) ?? null; } - getEntityOnRunHook(uid: string): CatelogEntityOnRunHook | undefined { + getEntityOnRunHook(uid: string): CatalogEntityOnRunHook | undefined { return catalogEntityRegistry.getOnRunHook(uid); }