File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,10 @@ class History {
119
119
public saveDocumentScrollPosition ( scrollRegion : ScrollRegion ) : void {
120
120
queue . add ( ( ) => {
121
121
return Promise . resolve ( ) . then ( ( ) => {
122
+ if ( ! window . history . state ?. page ) {
123
+ return
124
+ }
125
+
122
126
this . doReplaceState (
123
127
{
124
128
page : window . history . state . page ,
@@ -131,11 +135,11 @@ class History {
131
135
}
132
136
133
137
public getScrollRegions ( ) : ScrollRegion [ ] {
134
- return window . history . state . scrollRegions || [ ]
138
+ return window . history . state ? .scrollRegions || [ ]
135
139
}
136
140
137
141
public getDocumentScrollPosition ( ) : ScrollRegion {
138
- return window . history . state . documentScrollPosition || { top : 0 , left : 0 }
142
+ return window . history . state ? .documentScrollPosition || { top : 0 , left : 0 }
139
143
}
140
144
141
145
public replaceState ( page : Page , cb : ( ( ) => void ) | null = null ) : void {
You can’t perform that action at this time.
0 commit comments