File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
example-apps/internal-knowledge-search/app-ui/src/components Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -181,16 +181,23 @@ const SearchApplicationSettings: React.FC = () => {
181181
182182 const [ searchPersonaOptions , setSearchPersonaOptions ] = useState ( [ "admin" ] ) ;
183183
184+ // Populate personas dropdown options
184185 useEffect ( ( ) => {
185186 ( async ( ) => {
186187 const fetchedPersonas = await fetchPersonaOptions ( )
187188 setSearchPersonaOptions ( fetchedPersonas )
189+ } ) ( )
190+ } , [ ] )
191+
192+ // Ensure we have an API key and override the "missing" default
193+ useEffect ( ( ) => {
194+ ( async ( ) => {
188195 if ( searchPersonaAPIKey == "missing" ) {
189196 const createdAPIKey = await createPersonaAPIKey ( searchPersona )
190197 updateSearchPersonaAPIKey ( createdAPIKey )
191198 }
192199 } ) ( )
193- } , [ ] )
200+ } , [ ] )
194201
195202 const [ isOpen , setIsOpen ] = useState ( false ) ;
196203
You can’t perform that action at this time.
0 commit comments