aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/CaptureManager.tsx
diff options
context:
space:
mode:
authorSophie Zhang <sophie_zhang@brown.edu>2024-01-25 11:35:26 -0500
committerSophie Zhang <sophie_zhang@brown.edu>2024-01-25 11:35:26 -0500
commitf3dab2a56db5e4a6a3dca58185d94e1ff7d1dc32 (patch)
treea7bc895266b53bb620dbd2dd71bad2e83b555446 /src/client/util/CaptureManager.tsx
parentb5c5410b4af5d2c68d2107d3f064f6e3ec4ac3f2 (diff)
parent136f3d9f349d54e8bdd73b6380ea47c19e5edebf (diff)
Merge branch 'master' into sophie-ai-images
Diffstat (limited to 'src/client/util/CaptureManager.tsx')
-rw-r--r--src/client/util/CaptureManager.tsx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/util/CaptureManager.tsx b/src/client/util/CaptureManager.tsx
index f42336ee7..2e13aff2f 100644
--- a/src/client/util/CaptureManager.tsx
+++ b/src/client/util/CaptureManager.tsx
@@ -1,5 +1,5 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { action, computed, observable } from 'mobx';
+import { action, computed, makeObservable, observable } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
import { Doc } from '../../fields/Doc';
@@ -15,11 +15,12 @@ import { SelectionManager } from './SelectionManager';
export class CaptureManager extends React.Component<{}> {
public static Instance: CaptureManager;
static _settingsStyle = addStyleSheet();
- @observable _document: any;
+ @observable _document: any = undefined;
@observable isOpen: boolean = false; // whether the CaptureManager is to be displayed or not.
constructor(props: {}) {
super(props);
+ makeObservable(this);
CaptureManager.Instance = this;
}
@@ -73,7 +74,7 @@ export class CaptureManager extends React.Component<{}> {
<div
className="save"
onClick={() => {
- LightboxView.SetLightboxDoc(this._document);
+ LightboxView.Instance.SetLightboxDoc(this._document);
this.close();
}}>
Save
@@ -81,9 +82,9 @@ export class CaptureManager extends React.Component<{}> {
<div
className="cancel"
onClick={() => {
- const selected = SelectionManager.Views().slice();
+ const selected = SelectionManager.Views.slice();
SelectionManager.DeselectAll();
- selected.map(dv => dv.props.removeDocument?.(dv.props.Document));
+ selected.map(dv => dv.props.removeDocument?.(dv.Document));
this.close();
}}>
Cancel