Check for dup registerType
This commit is contained in:
parent
194746f3ac
commit
fac8998ba2
1 changed files with 5 additions and 0 deletions
|
@ -6,6 +6,7 @@ import {IntlShape} from 'react-intl'
|
|||
import {BlockTypes} from '../../blocks/block'
|
||||
import {Card} from '../../blocks/card'
|
||||
import {IContentBlock, MutableContentBlock} from '../../blocks/contentBlock'
|
||||
import {Utils} from '../../utils'
|
||||
|
||||
type ContentHandler = {
|
||||
type: BlockTypes,
|
||||
|
@ -24,6 +25,10 @@ class ContentRegistry {
|
|||
}
|
||||
|
||||
registerContentType(entry: ContentHandler) {
|
||||
if (this.isContentType(entry.type)) {
|
||||
Utils.logError(`registerContentType, already registered type: ${entry.type}`)
|
||||
return
|
||||
}
|
||||
this.registry.set(entry.type, entry)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue