@@ -115,37 +115,37 @@ export class SharedNotebookRenderStrategy implements ExpandableNodeRenderStrateg
115
115
}
116
116
117
117
private onExpand ( ) {
118
- if ( this . isExpandable ( ) ) {
119
- if ( ! this . notebook . apiProperties && ! this . notebook . startedLoading && this . globals . oneNoteDataProvider ) {
120
- // This notebook was made known to us by GetRecentNotebooks, but we haven't
121
- // fetched any metadata or children info
122
- this . notebook . startedLoading = true ;
123
- const depth = this . globals . notebookExpandDepth || 5 ;
124
-
125
- this . globals . oneNoteDataProvider . getSpNotebookProperties ( this . notebook , depth , true ) . then ( ( apiProperties ) => {
126
- if ( ! apiProperties ) {
127
- this . notebook . apiHttpErrorCode = 404 ;
128
- return ;
129
- }
130
-
131
- this . notebook . apiProperties = apiProperties ;
132
-
133
- if ( this . globals . notebookListUpdater ) {
134
- this . globals . notebookListUpdater . updateNotebookList ( [ this . notebook ] ) ;
135
- }
136
- } ) . catch ( ( xhrs : XMLHttpRequest [ ] ) => {
137
- let max = 0 ;
138
- for ( let i = 0 ; i < xhrs . length ; i ++ ) {
139
- max = Math . max ( xhrs [ i ] . status , max ) ;
140
- }
141
- this . notebook . apiHttpErrorCode = max ;
142
- } ) . then ( ( ) => {
143
- let { onSharedNotebookInfoReturned } = this . globals . callbacks ;
144
- if ( ! ! onSharedNotebookInfoReturned ) {
145
- onSharedNotebookInfoReturned ( this . notebook ) ;
146
- }
147
- } ) ;
148
- }
118
+ // Check if the picker is expandable
119
+ if ( ( this . globals . callbacks . onSectionSelected || ! ! this . globals . callbacks . onPageSelected ) &&
120
+ ! this . notebook . apiProperties && ! this . notebook . startedLoading && this . globals . oneNoteDataProvider ) {
121
+ // This notebook was made known to us by GetRecentNotebooks, but we haven't
122
+ // fetched any metadata or children info
123
+ this . notebook . startedLoading = true ;
124
+ const depth = this . globals . notebookExpandDepth || 5 ;
125
+
126
+ this . globals . oneNoteDataProvider . getSpNotebookProperties ( this . notebook , depth , true ) . then ( ( apiProperties ) => {
127
+ if ( ! apiProperties ) {
128
+ this . notebook . apiHttpErrorCode = 404 ;
129
+ return ;
130
+ }
131
+
132
+ this . notebook . apiProperties = apiProperties ;
133
+
134
+ if ( this . globals . notebookListUpdater ) {
135
+ this . globals . notebookListUpdater . updateNotebookList ( [ this . notebook ] ) ;
136
+ }
137
+ } ) . catch ( ( xhrs : XMLHttpRequest [ ] ) => {
138
+ let max = 0 ;
139
+ for ( let i = 0 ; i < xhrs . length ; i ++ ) {
140
+ max = Math . max ( xhrs [ i ] . status , max ) ;
141
+ }
142
+ this . notebook . apiHttpErrorCode = max ;
143
+ } ) . then ( ( ) => {
144
+ let { onSharedNotebookInfoReturned } = this . globals . callbacks ;
145
+ if ( ! ! onSharedNotebookInfoReturned ) {
146
+ onSharedNotebookInfoReturned ( this . notebook ) ;
147
+ }
148
+ } ) ;
149
149
}
150
150
}
151
151
@@ -154,8 +154,4 @@ export class SharedNotebookRenderStrategy implements ExpandableNodeRenderStrateg
154
154
let split = url . split ( '/' ) ;
155
155
return split . slice ( 3 , - 1 ) . map ( decodeURIComponent ) . join ( '/' ) ;
156
156
}
157
-
158
- private isExpandable ( ) : boolean {
159
- return ! ! this . globals . callbacks . onSectionSelected || ! ! this . globals . callbacks . onPageSelected ;
160
- }
161
157
}
0 commit comments