config passed with configUrl in constructor
This commit is contained in:
@@ -27,9 +27,7 @@ export default function configPlugin (toolbox) {
|
||||
return fetch(url)
|
||||
},
|
||||
|
||||
getConfigByUrl: (callback)=> ({ specActions }) => {
|
||||
let config = parseSeach()
|
||||
let configUrl = config.config
|
||||
getConfigByUrl: (configUrl, cb)=> ({ specActions }) => {
|
||||
if (configUrl) {
|
||||
return specActions.downloadConfig(configUrl).then(next, next)
|
||||
}
|
||||
@@ -37,9 +35,12 @@ export default function configPlugin (toolbox) {
|
||||
function next(res) {
|
||||
if (res instanceof Error || res.status >= 400) {
|
||||
specActions.updateLoadingStatus("failedConfig")
|
||||
specActions.updateLoadingStatus("failedConfig")
|
||||
specActions.updateUrl("")
|
||||
console.error(res.statusText + " " + configUrl)
|
||||
cb(null)
|
||||
} else {
|
||||
callback(parseYamlConfig(res.text))
|
||||
cb(parseYamlConfig(res.text))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user