mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-12 05:04:56 +03:00
publish: fetch notebook during navigation
This commit is contained in:
parent
90e2a94b58
commit
07f5e037f7
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user