diff options
Diffstat (limited to 'src/client/util/SelectionManager.ts')
| -rw-r--r-- | src/client/util/SelectionManager.ts | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/client/util/SelectionManager.ts b/src/client/util/SelectionManager.ts index e864458d8..f7e6fa2dc 100644 --- a/src/client/util/SelectionManager.ts +++ b/src/client/util/SelectionManager.ts @@ -64,11 +64,8 @@ export namespace SelectionManager { manager.SelectSchemaViewDoc(document); } - // computed functions, such as used in IsSelected generate errors if they're called outside of a - // reaction context. Specifying the context with 'outsideReaction' allows an efficiency feature - // to avoid unnecessary mobx invalidations when running inside a reaction. - export function IsSelected(dv?: DocumentView | Doc): boolean { - return (dv instanceof Doc ? Array.from(dv[DocViews]) : dv ? [dv] : []).some(dv => dv?.SELECTED); + export function IsSelected(doc?: Doc): boolean { + return Array.from(doc?.[DocViews] ?? []).some(dv => dv?.SELECTED); } export function DeselectAll(except?: Doc): void { |
