File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
packages/plugin-docusaurus-v3/src/theme/SearchBar Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -72,14 +72,26 @@ export function OramaSearchNoDocs() {
7272 )
7373}
7474
75+ function getVersionName ( version : string | { name : string } | null ) : string | undefined {
76+ if ( ! version ) {
77+ return undefined
78+ }
79+
80+ if ( typeof version === 'string' ) {
81+ return version
82+ }
83+
84+ return version . name
85+ }
86+
7587export function OramaSearchWithDocs ( { pluginId } : { pluginId : string } ) {
7688 const colorMode = getColorMode ( )
7789 const { searchBoxConfig, searchBtnConfig } = useOrama ( )
7890 const collectionManager = searchBoxConfig . basic ?. collectionManager
7991 const versions = useVersions ( pluginId )
8092 const activeVersion = useActiveVersion ( pluginId )
8193 const preferredVersion = getPreferredVersion ( searchBoxConfig . basic . clientInstance )
82- const currentVersion = activeVersion || preferredVersion || versions [ 0 ]
94+ const currentVersion = getVersionName ( activeVersion ) || getVersionName ( preferredVersion ) || getVersionName ( versions [ 0 ] ) ;
8395
8496 const searchParams = {
8597 ...( currentVersion && {
You can’t perform that action at this time.
0 commit comments