fixed issue with isSpell no longer being defined
This commit is contained in:
@@ -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 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<CreatureProperty>): void {
|
export default function computeInactiveStatus(node: TreeNode<CreatureProperty>): void {
|
||||||
const prop = node.doc;
|
const prop = node.doc;
|
||||||
@@ -21,7 +20,7 @@ export default function computeInactiveStatus(node: TreeNode<CreatureProperty>):
|
|||||||
|
|
||||||
function isActive(prop: CreatureProperty): boolean {
|
function isActive(prop: CreatureProperty): boolean {
|
||||||
if (prop.disabled) return false;
|
if (prop.disabled) return false;
|
||||||
if (isSpell(prop)) {
|
if (prop.type === 'spell') {
|
||||||
return !!prop.prepared || !!prop.alwaysPrepared;
|
return !!prop.prepared || !!prop.alwaysPrepared;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1,21 +1,13 @@
|
|||||||
import SimpleSchema from 'simpl-schema';
|
import SimpleSchema from 'simpl-schema';
|
||||||
import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS';
|
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 {
|
export interface Reference {
|
||||||
collection: string,
|
collection: string,
|
||||||
id: string,
|
id: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TreeDoc {
|
|
||||||
_id: string,
|
|
||||||
root: Reference,
|
|
||||||
parentId?: string,
|
|
||||||
left: number,
|
|
||||||
right: number,
|
|
||||||
removed?: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
const RefSchema = TypedSimpleSchema.from({
|
const RefSchema = TypedSimpleSchema.from({
|
||||||
id: {
|
id: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -84,5 +76,7 @@ export const treeDocFields = {
|
|||||||
right: 1,
|
right: 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type TreeDoc = Simplify<{ _id: string } & InferType<typeof ChildSchema>>;
|
||||||
|
|
||||||
export default ChildSchema;
|
export default ChildSchema;
|
||||||
export { RefSchema };
|
export { RefSchema };
|
||||||
|
|||||||
Reference in New Issue
Block a user