File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " solid-navigator" ,
3- "version" : " 0.4.0 " ,
3+ "version" : " 0.4.1 " ,
44 "description" : " Solid Navigator is a library that is inspired by vue router and solid router." ,
55 "license" : " MIT" ,
66 "author" : " SupertigerDev" ,
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export const createNavigate = (
1818 return ( path : string , options ?: NavigateOptions ) => {
1919 let newPath = path
2020 let currentPathname = pathname ( )
21+ const currentSearchAndHash = getSearchAndHash ( )
2122
2223 if ( currentPathname . endsWith ( '/' ) ) {
2324 currentPathname = currentPathname . slice ( 0 , - 1 )
@@ -31,6 +32,9 @@ export const createNavigate = (
3132 newPath = currentPathname + '/' + newPath
3233 }
3334
35+ const pathAndSearch = currentPathname + currentSearchAndHash
36+ if ( pathAndSearch === newPath ) return
37+
3438 if ( options ?. replace ) {
3539 history . replaceState ( options . state || null , '' , newPath )
3640 } else {
You can’t perform that action at this time.
0 commit comments