fix: duplicate downloading of remote config (#6544)
This commit is contained in:
committed by
GitHub
parent
671e945376
commit
50e5f653cc
@@ -177,15 +177,15 @@ export default function SwaggerUI(opts) {
|
|||||||
|
|
||||||
const configUrl = queryConfig.config || constructorConfig.configUrl
|
const configUrl = queryConfig.config || constructorConfig.configUrl
|
||||||
|
|
||||||
if (!configUrl || !system.specActions || !system.specActions.getConfigByUrl || system.specActions.getConfigByUrl && !system.specActions.getConfigByUrl({
|
if (configUrl && system.specActions && system.specActions.getConfigByUrl) {
|
||||||
url: configUrl,
|
system.specActions.getConfigByUrl({
|
||||||
loadRemoteConfig: true,
|
url: configUrl,
|
||||||
requestInterceptor: constructorConfig.requestInterceptor,
|
loadRemoteConfig: true,
|
||||||
responseInterceptor: constructorConfig.responseInterceptor,
|
requestInterceptor: constructorConfig.requestInterceptor,
|
||||||
}, downloadSpec)) {
|
responseInterceptor: constructorConfig.responseInterceptor,
|
||||||
return downloadSpec()
|
}, downloadSpec)
|
||||||
} else {
|
} else {
|
||||||
system.specActions.getConfigByUrl(configUrl, downloadSpec)
|
return downloadSpec()
|
||||||
}
|
}
|
||||||
|
|
||||||
return system
|
return system
|
||||||
|
|||||||
Reference in New Issue
Block a user