From 3b628238e9cf155941d949086de44320ceb8e18d Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Wed, 31 Jul 2019 18:23:45 -0400 Subject: try cast fix --- src/client/util/DictationManager.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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 = (view: DocumentView, ctor: T) => Cast(Doc.GetProto(view.props.Document).data, ctor); + const tryCast = (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); } -- cgit v1.2.3-70-g09d2