From 12789f1c5eea1fa2d97f05bf55ece24baad8b5c7 Mon Sep 17 00:00:00 2001 From: Thaum Rystra <9525416+ThaumRystra@users.noreply.github.com> Date: Wed, 15 Jan 2025 17:40:44 +0200 Subject: [PATCH] fixed issue with isSpell no longer being defined --- .../buildComputation/computeInactiveStatus.ts | 7 +++---- app/imports/api/parenting/ChildSchema.ts | 14 ++++---------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/app/imports/api/engine/computation/buildComputation/computeInactiveStatus.ts b/app/imports/api/engine/computation/buildComputation/computeInactiveStatus.ts index 4d8772f1..52a56df1 100644 --- a/app/imports/api/engine/computation/buildComputation/computeInactiveStatus.ts +++ b/app/imports/api/engine/computation/buildComputation/computeInactiveStatus.ts @@ -1,7 +1,6 @@ -import { CreatureProperty } from '/imports/api/creature/creatureProperties/CreatureProperties'; +import type { CreatureProperty } from '/imports/api/creature/creatureProperties/CreatureProperties'; +import type { TreeNode } from '/imports/api/parenting/parentingFunctions'; import walkDown from '/imports/api/engine/computation/utility/walkdown'; -import { TreeNode } from '/imports/api/parenting/parentingFunctions'; -import { isSpell } from '/imports/api/properties/Spells'; export default function computeInactiveStatus(node: TreeNode): void { const prop = node.doc; @@ -21,7 +20,7 @@ export default function computeInactiveStatus(node: TreeNode): function isActive(prop: CreatureProperty): boolean { if (prop.disabled) return false; - if (isSpell(prop)) { + if (prop.type === 'spell') { return !!prop.prepared || !!prop.alwaysPrepared; } return true; diff --git a/app/imports/api/parenting/ChildSchema.ts b/app/imports/api/parenting/ChildSchema.ts index ccf5a829..21ad044b 100644 --- a/app/imports/api/parenting/ChildSchema.ts +++ b/app/imports/api/parenting/ChildSchema.ts @@ -1,21 +1,13 @@ import SimpleSchema from 'simpl-schema'; import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; -import { TypedSimpleSchema } from '/imports/api/utility/TypedSimpleSchema'; +import { InferType, TypedSimpleSchema } from '/imports/api/utility/TypedSimpleSchema'; +import type { Simplify } from 'type-fest'; export interface Reference { collection: string, id: string, } -export interface TreeDoc { - _id: string, - root: Reference, - parentId?: string, - left: number, - right: number, - removed?: true, -} - const RefSchema = TypedSimpleSchema.from({ id: { type: String, @@ -84,5 +76,7 @@ export const treeDocFields = { right: 1, } +export type TreeDoc = Simplify<{ _id: string } & InferType>; + export default ChildSchema; export { RefSchema };