修复备忘录jscrash

Signed-off-by: zwx1126739 <zhanghong121@huawei.com>
This commit is contained in:
zwx1126739
2024-09-06 10:35:41 +08:00
parent 764fc5d7ea
commit 79ecfa90fb
@@ -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)