File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/components/LocationProvider Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ export function LocationProvider({ children }: ILocationProviderProps) {
4646 const version =
4747 newParams ?. version . substring ( 0 , SHORT_COMMIT_HASH_LENGTH ) ||
4848 metadata . versions [ metadata . latest ] ?. hash . substring ( 0 , SHORT_COMMIT_HASH_LENGTH ) ;
49+ const versionName = newParams ? metadata . versions [ newParams . version ] ?. name : undefined ;
4950
5051 const stringifiedParams = [ ] ;
5152
@@ -58,7 +59,8 @@ export function LocationProvider({ children }: ILocationProviderProps) {
5859 ] . join ( "" ) ;
5960 }
6061
61- window . location . hash = `${ SEGMENT_SEPARATOR } ${ stringifiedParams . join ( SEGMENT_SEPARATOR ) } ` ;
62+ const newHash = `${ SEGMENT_SEPARATOR } ${ stringifiedParams . join ( SEGMENT_SEPARATOR ) } ` ;
63+ window . location . hash = versionName ? `${ newHash } ?v=${ versionName } ` : newHash ;
6264 } ,
6365 [ metadata ] ,
6466 ) ;
You can’t perform that action at this time.
0 commit comments