diff options
author | bobzel <zzzman@gmail.com> | 2023-11-07 13:48:26 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-11-07 13:48:26 -0500 |
commit | a6cc25e5d03ffed16bfaa32e48e9cc2eaff7deaf (patch) | |
tree | 1322ef9a743457f23851ba7c9d5d3dd090f1f75d /src/fields/Types.ts | |
parent | a4e3b645317c4589cf49f8007f6e6b57cf2c12d3 (diff) |
Changed how selection works to avoid invalidations. Fixed Cast problem with ProxyFields that caused renameEmbedding to infinite loop.. Changed brushing for the same reason. Cleaned up a few things with filter code.
Diffstat (limited to 'src/fields/Types.ts')
-rw-r--r-- | src/fields/Types.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fields/Types.ts b/src/fields/Types.ts index 69dbe9756..337e8ca21 100644 --- a/src/fields/Types.ts +++ b/src/fields/Types.ts @@ -1,6 +1,7 @@ import { DateField } from './DateField'; import { Doc, Field, FieldResult, Opt } from './Doc'; import { List } from './List'; +import { ProxyField } from './Proxy'; import { RefField } from './RefField'; import { RichTextField } from './RichTextField'; import { ScriptField } from './ScriptField'; @@ -72,6 +73,8 @@ export function Cast<T extends CastCtor>(field: FieldResult, ctor: T, defaultVal } } else if (field instanceof (ctor as any)) { return field as ToType<T>; + } else if (field instanceof ProxyField && field.value instanceof (ctor as any)) { + return field.value as ToType<T>; } } return defaultVal === null ? undefined : defaultVal; |