File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -112,8 +112,8 @@ const NextTopLoader = ({
112
112
! shadow && shadow !== undefined
113
113
? ''
114
114
: shadow
115
- ? `box-shadow:${ shadow } `
116
- : `box-shadow:0 0 10px ${ color } ,0 0 5px ${ color } ` ;
115
+ ? `box-shadow:${ shadow } `
116
+ : `box-shadow:0 0 10px ${ color } ,0 0 5px ${ color } ` ;
117
117
118
118
// Check if to show at bottom
119
119
const positionStyle = showAtBottom ? 'bottom: 0;' : 'top: 0;' ;
@@ -270,7 +270,7 @@ const NextTopLoader = ({
270
270
}
271
271
272
272
/**
273
- * Complete TopLoader Progress
273
+ * Complete TopLoader Progress on adding new entry to history stack
274
274
* @param {History }
275
275
* @returns {void }
276
276
*/
@@ -283,6 +283,20 @@ const NextTopLoader = ({
283
283
} ;
284
284
} ) ( ( window as Window ) . history ) ;
285
285
286
+ /**
287
+ * Complete TopLoader Progress on replacing current entry of history stack
288
+ * @param {History }
289
+ * @returns {void }
290
+ */
291
+ ( ( history : History ) : void => {
292
+ const replaceState = history . replaceState ;
293
+ history . replaceState = ( ...args ) => {
294
+ NProgress . done ( ) ;
295
+ removeNProgressClass ( ) ;
296
+ return replaceState . apply ( history , args ) ;
297
+ } ;
298
+ } ) ( ( window as Window ) . history ) ;
299
+
286
300
function handlePageHide ( ) : void {
287
301
NProgress . done ( ) ;
288
302
removeNProgressClass ( ) ;
You can’t perform that action at this time.
0 commit comments