aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentButtonBar.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/DocumentButtonBar.tsx')
-rw-r--r--src/client/views/DocumentButtonBar.tsx13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index 6950bec14..15e90ac2a 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -243,23 +243,18 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (
);
}
- @observable _annoSaved: boolean = false;
-
@undoBatch
- saveAnno = action((targetDoc: Doc) => {
- // targetDoc.savedAsAnno = true;
- this._annoSaved = true;
- // AnnotationPalette.addToPalette(targetDoc);
+ saveAnno = action(async (targetDoc: Doc) => {
+ await AnnotationPalette.addToPalette(targetDoc);
});
@computed
get saveAnnoButton() {
const targetDoc = this.view0?.Document;
- if (targetDoc && targetDoc.savedAsAnno) this._annoSaved = true;
return !targetDoc ? null : (
- <Tooltip title={<div className="dash-tooltip">{this._annoSaved ? 'Saved as Annotation!' : 'Save to Annotation Palette'}</div>}>
+ <Tooltip title={<div className="dash-tooltip">{targetDoc.savedAsAnno ? 'Saved as Annotation!' : 'Save to Annotation Palette'}</div>}>
<div className="documentButtonBar-icon" style={{ color: 'white' }} onClick={() => this.saveAnno(targetDoc)}>
- <FontAwesomeIcon className="documentdecorations-icon" icon={this._annoSaved ? 'clipboard-check' : 'file-arrow-down'} />
+ <FontAwesomeIcon className="documentdecorations-icon" icon={targetDoc.savedAsAnno ? 'clipboard-check' : 'file-arrow-down'} />
</div>
</Tooltip>
);