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