diff options
author | Sam Wilkins <samwilkins333@gmail.com> | 2019-07-31 18:23:45 -0400 |
---|---|---|
committer | Sam Wilkins <samwilkins333@gmail.com> | 2019-07-31 18:23:45 -0400 |
commit | 3b628238e9cf155941d949086de44320ceb8e18d (patch) | |
tree | 2cfd11e0a65c02491292ed7b7c838ca856cda87b | |
parent | bbad2e964edb8ae58a5b611003dcba5ba170503d (diff) |
try cast fix
-rw-r--r-- | src/client/util/DictationManager.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/util/DictationManager.ts b/src/client/util/DictationManager.ts index 5c318fc9b..3e130f984 100644 --- a/src/client/util/DictationManager.ts +++ b/src/client/util/DictationManager.ts @@ -21,11 +21,11 @@ namespace CORE { export namespace Validators { - const tryCast = <T extends CastCtor>(view: DocumentView, ctor: T) => Cast(Doc.GetProto(view.props.Document).data, ctor); + const tryCast = <T extends CastCtor>(view: DocumentView, ctor: T) => Cast(Doc.GetProto(view.props.Document).data, ctor) !== undefined; - export const isCollectionView: ActionPredicate = (target: DocumentView) => tryCast(target, listSpec(Doc)) !== undefined; + export const isCollectionView: ActionPredicate = (target: DocumentView) => tryCast(target, listSpec(Doc)); - export const isImageView: ActionPredicate = (target: DocumentView) => tryCast(target, ImageField) !== undefined; + export const isImageView: ActionPredicate = (target: DocumentView) => tryCast(target, ImageField); } |