diff --git a/features/src/main/ets/components/NoteListComp.ets b/features/src/main/ets/components/NoteListComp.ets index 7713621269652a6b257ff1e400febe8014fefd59..0095c1df459dae45404b70d1d4ab40f63624c583 100644 --- a/features/src/main/ets/components/NoteListComp.ets +++ b/features/src/main/ets/components/NoteListComp.ets @@ -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('NewNote', this.selectedNoteData)