fix regression with editorjs: content not loaded

This commit is contained in:
Simon Vieille 2022-05-08 22:26:10 +02:00
parent 170e74b5b7
commit 6bf65ccd2b
2 changed files with 3 additions and 6 deletions

View File

@ -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

View File

@ -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,