fix regression with editorjs: content not loaded
This commit is contained in:
parent
170e74b5b7
commit
6bf65ccd2b
|
@ -12,6 +12,7 @@
|
|||
### Fixed
|
||||
* fix the mail notifier
|
||||
* fix sitemap: navigation with several domains
|
||||
* fix regression with editorjs: content not loaded
|
||||
|
||||
## [1.14.1] - 2022-04-30
|
||||
### Added
|
||||
|
|
|
@ -147,21 +147,17 @@ const doInitEditor = () => {
|
|||
editorContainer.attr('id', id)
|
||||
element.hide()
|
||||
|
||||
let data = []
|
||||
let data = {time: null, blocks: []};
|
||||
|
||||
try {
|
||||
const value = JSON.parse(element.val())
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
if (value.time && Array.isArray(value.blocks)) {
|
||||
data = value
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
if (!Array.isArray(data)) {
|
||||
data = []
|
||||
}
|
||||
|
||||
const editor = new EditorJS(buildConfiguration({
|
||||
holder: id,
|
||||
data: data,
|
||||
|
|
Loading…
Reference in New Issue