修复备忘录jscrash

Signed-off-by: zwx1126739 <zhanghong121@huawei.com>
This commit is contained in:
zwx1126739 2024-09-06 10:35:41 +08:00
parent 20d3ce52dc
commit c0503b2a46

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)