File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
packages/reactant-share/src/modules Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -152,10 +152,15 @@ class ReactantRouter extends BaseReactantRouter {
152152 ( ) => this . router ,
153153 ( router ) => {
154154 if (
155- router ?. location . pathname !==
156- this . cachedHistory [ 0 ] ?. location ?. pathname
155+ router &&
156+ router . location . pathname !==
157+ this . cachedHistory [ 0 ] ?. location ?. pathname
157158 ) {
158- this . cachedHistory . unshift ( router ! ) ;
159+ if ( router . action === 'REPLACE' ) {
160+ this . cachedHistory [ 0 ] = router ;
161+ } else {
162+ this . cachedHistory . unshift ( router ! ) ;
163+ }
159164 this . cachedHistory . length = this . maxHistoryLength ; // Limit the length of the historical stack
160165 }
161166 }
@@ -273,7 +278,7 @@ class ReactantRouter extends BaseReactantRouter {
273278 }
274279
275280 get maxHistoryLength ( ) {
276- return this . options . maxHistoryLength ?? 10 ;
281+ return this . options . maxHistoryLength ?? 50 ;
277282 }
278283
279284 watchRehydratedRouting ( ) {
You can’t perform that action at this time.
0 commit comments