From 07f5e037f786290931996b4c5c26af753740cb8e Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Fri, 5 Jun 2020 17:34:05 -0400 Subject: [PATCH] publish: fetch notebook during navigation --- pkg/interface/src/apps/publish/components/lib/notebook.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/interface/src/apps/publish/components/lib/notebook.js b/pkg/interface/src/apps/publish/components/lib/notebook.js index 955293277..6faecc9b1 100644 --- a/pkg/interface/src/apps/publish/components/lib/notebook.js +++ b/pkg/interface/src/apps/publish/components/lib/notebook.js @@ -41,7 +41,7 @@ export class Notebook extends Component { componentDidUpdate(prevProps) { const { props } = this; - if (prevProps && prevProps.api !== props.api) { + if ((prevProps && (prevProps.api !== props.api)) || props.api) { const notebook = props.notebooks?.[props.ship]?.[props.book]; if (!notebook?.subscribers) { props.api.fetchNotebook(props.ship, props.book); @@ -50,6 +50,7 @@ export class Notebook extends Component { } componentDidMount() { + this.componentDidUpdate(); const notebook = this.props.notebooks?.[this.props.ship]?.[this.props.book]; if (notebook?.notes) { this.onScroll();