mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-25 03:08:34 +00:00
core: make mount()ing an unknown plugin a noop
This commit is contained in:
parent
36365b90f9
commit
9174abf855
1 changed files with 20 additions and 17 deletions
|
|
@ -73,24 +73,27 @@ module.exports = class Plugin {
|
|||
targetElement.appendChild(this.el)
|
||||
|
||||
return targetElement
|
||||
} else {
|
||||
const Target = target
|
||||
// Find the target plugin instance.
|
||||
let targetPlugin
|
||||
this.core.iteratePlugins((plugin) => {
|
||||
if (plugin instanceof Target) {
|
||||
targetPlugin = plugin
|
||||
return false
|
||||
}
|
||||
})
|
||||
const targetPluginName = targetPlugin.id
|
||||
|
||||
this.core.log(`Installing ${callerPluginName} to ${targetPluginName}`)
|
||||
|
||||
const selectorTarget = targetPlugin.addTarget(plugin)
|
||||
|
||||
return selectorTarget
|
||||
}
|
||||
|
||||
const Target = target
|
||||
// Find the target plugin instance.
|
||||
let targetPlugin
|
||||
this.core.iteratePlugins((plugin) => {
|
||||
if (plugin instanceof Target) {
|
||||
targetPlugin = plugin
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
if (targetPlugin) {
|
||||
const targetPluginName = targetPlugin.id
|
||||
this.core.log(`Installing ${callerPluginName} to ${targetPluginName}`)
|
||||
return targetPlugin.addTarget(plugin)
|
||||
}
|
||||
|
||||
this.core.log(`Not installing ${callerPluginName}`)
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
unmount () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue