!286 修复备忘录jscrash

Merge pull request !286 from 张宏/0906
This commit is contained in:
openharmony_ci 2024-09-06 09:06:43 +00:00 committed by Gitee
commit 9f43b46130
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -451,12 +451,18 @@ export struct NoteItemComp {
LogUtil.info(TAG, "NoteItemComp, set continue note success")
}
if (this.portraitModel == false) {
this.controllerShow.runJavaScript(
"RICH_EDITOR.setHtml('" + this.selectedNoteData?.content_text + "')"
)
this.controllerShow.runJavaScript(
"RICH_EDITOR.cancelSelection()"
)
try {
this.controllerShow.runJavaScript(
"RICH_EDITOR.setHtml('" + this.selectedNoteData?.content_text + "')"
)
this.controllerShow.runJavaScript(
"RICH_EDITOR.cancelSelection()"
)
LogUtil.info(TAG, `runJavaScript setHtml and cancelSelection success`);
} catch (error) {
LogUtil.error(TAG, `runJavaScript setHtml and cancelSelection failed.
code:${JSON.stringify(error.code)},message:${JSON.stringify(error.message)}`);
}
}
if (this.portraitModel == true) {
AppStorage.SetOrCreate<NoteData>('NewNote', this.selectedNoteData)