diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-07-23 14:40:57 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-07-23 14:40:57 -0400 |
commit | feb86078832da5f7207bc5775a61d7dd93681e98 (patch) | |
tree | eb5d6aeccf78d07678c260a3c3a84eb309cfd97b /src/client/views/PropertiesButtons.tsx | |
parent | 05c46464ba69e889145d8a32320cd7f130665ee1 (diff) |
fixes for gettin new sidebar to work
Diffstat (limited to 'src/client/views/PropertiesButtons.tsx')
-rw-r--r-- | src/client/views/PropertiesButtons.tsx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/client/views/PropertiesButtons.tsx b/src/client/views/PropertiesButtons.tsx index 1b06a41fa..b55593b11 100644 --- a/src/client/views/PropertiesButtons.tsx +++ b/src/client/views/PropertiesButtons.tsx @@ -68,8 +68,14 @@ export class PropertiesButtons extends React.Component<{}, {}> { public static hasPushedHack = false; public static hasPulledHack = false; - @observable selectedDocumentView: DocumentView | undefined = SelectionManager.LastSelection(); - @observable selectedDoc: Doc | undefined = this.selectedDocumentView?.props.Document; + + @computed get selectedDocumentView() { + if (SelectionManager.SelectedDocuments().length) { + return SelectionManager.SelectedDocuments()[0]; + } else { return undefined; } + } + @computed get selectedDoc() { return this.selectedDocumentView?.props.Document; } + @computed get dataDoc() { return this.selectedDocumentView?.props.DataDoc; } public startPullOutcome = action((success: boolean) => { if (!this._pullAnimating) { |