File tree 1 file changed +6
-8
lines changed
1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -37,10 +37,9 @@ class History {
37
37
return
38
38
}
39
39
40
- cb = cb ?? ( ( ) => { } )
41
-
42
40
if ( this . preserveUrl ) {
43
- return cb ( )
41
+ cb && cb ( )
42
+ return
44
43
}
45
44
46
45
this . current = page
@@ -51,7 +50,7 @@ class History {
51
50
// Ensure any previous history.replaceState completes before pushState is executed.
52
51
const doPush = ( ) => {
53
52
this . doPushState ( { page : data } , page . url )
54
- cb ( )
53
+ cb && cb ( )
55
54
}
56
55
57
56
if ( isChromeIOS ) {
@@ -142,10 +141,9 @@ class History {
142
141
return
143
142
}
144
143
145
- cb = cb ?? ( ( ) => { } )
146
-
147
144
if ( this . preserveUrl ) {
148
- return cb ( )
145
+ cb && cb ( )
146
+ return
149
147
}
150
148
151
149
this . current = page
@@ -156,7 +154,7 @@ class History {
156
154
// Ensure any previous history.pushState completes before replaceState is executed.
157
155
const doReplace = ( ) => {
158
156
this . doReplaceState ( { page : data } , page . url )
159
- cb ( )
157
+ cb && cb ( )
160
158
}
161
159
162
160
if ( isChromeIOS ) {
You can’t perform that action at this time.
0 commit comments