File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -54,13 +54,15 @@ class PDFOutlineViewer extends BaseTreeViewer {
54
54
this . eventBus . _on ( "pagesloaded" , evt => {
55
55
this . _isPagesLoaded = ! ! evt . pagesCount ;
56
56
57
- // If the capability is still pending, note the `_dispatchEvent`-method,
58
- // we know that the `currentOutlineItem`-button should be enabled here.
57
+ // If the capability is still pending, see the `_dispatchEvent`-method,
58
+ // we know that the `currentOutlineItem`-button can be enabled here.
59
59
if (
60
60
this . _currentOutlineItemCapability &&
61
61
! this . _currentOutlineItemCapability . settled
62
62
) {
63
- this . _currentOutlineItemCapability . resolve ( /* enabled = */ true ) ;
63
+ this . _currentOutlineItemCapability . resolve (
64
+ /* enabled = */ this . _isPagesLoaded
65
+ ) ;
64
66
}
65
67
} ) ;
66
68
this . eventBus . _on ( "sidebarviewchanged" , evt => {
@@ -95,6 +97,8 @@ class PDFOutlineViewer extends BaseTreeViewer {
95
97
this . _pdfDocument ?. loadingParams . disableAutoFetch
96
98
) {
97
99
this . _currentOutlineItemCapability . resolve ( /* enabled = */ false ) ;
100
+ } else if ( this . _isPagesLoaded ) {
101
+ this . _currentOutlineItemCapability . resolve ( /* enabled = */ true ) ;
98
102
}
99
103
100
104
this . eventBus . dispatch ( "outlineloaded" , {
You can’t perform that action at this time.
0 commit comments