This commit is contained in:
Philipp Kühn 2020-04-12 19:22:24 +02:00
parent 9bf8be403f
commit 3e7e351f93

View File

@ -500,7 +500,8 @@ export default class Editor extends Emitter {
registerPlugin(plugin = null, handlePlugins) { registerPlugin(plugin = null, handlePlugins) {
const plugins = typeof handlePlugins === 'function' const plugins = typeof handlePlugins === 'function'
? handlePlugins(plugin, this.state.plugins) : [...plugin, this.state.plugins] ? handlePlugins(plugin, this.state.plugins)
: [plugin, ...this.state.plugins]
const newState = this.state.reconfigure({ plugins }) const newState = this.state.reconfigure({ plugins })
this.view.updateState(newState) this.view.updateState(newState)
} }