From 2f1782b98a0e4e112fca3664c5c6ea5b72585c04 Mon Sep 17 00:00:00 2001 From: yiqiang Date: Sat, 8 Oct 2022 16:44:12 +0800 Subject: [PATCH] insert the same value return Signed-off-by: yiqiang --- common/component/src/main/ets/components/NoteContent.ets | 4 ++++ common/component/src/main/ets/components/NoteContentComp.ets | 4 ++++ .../src/main/ets/components/NoteContentCompPortrait.ets | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/common/component/src/main/ets/components/NoteContent.ets b/common/component/src/main/ets/components/NoteContent.ets index a60fe1e..fbf03c2 100644 --- a/common/component/src/main/ets/components/NoteContent.ets +++ b/common/component/src/main/ets/components/NoteContent.ets @@ -66,6 +66,10 @@ export struct NoteContent { callbackScheduledSave: (html) => { LogUtil.info(TAG, 'callbackScheduledSave') + if (this.selectedNoteData.content_text == html) { + LogUtil.info(TAG, 'callbackScheduledSave the same value return') + return; + } this.selectedNoteData.content_text = html this.selectedNoteData.modified_time = new Date().getTime() // updata note image diff --git a/common/component/src/main/ets/components/NoteContentComp.ets b/common/component/src/main/ets/components/NoteContentComp.ets index b6e495a..3135707 100644 --- a/common/component/src/main/ets/components/NoteContentComp.ets +++ b/common/component/src/main/ets/components/NoteContentComp.ets @@ -94,6 +94,10 @@ export struct NoteContentComp { callbackScheduledSave: (html) => { LogUtil.info(TAG, 'callbackScheduledSave') + if (this.selectedNoteData.content_text == html) { + LogUtil.info(TAG, 'callbackScheduledSave the same value return') + return; + } this.selectedNoteData.content_text = html this.selectedNoteData.modified_time = new Date().getTime() // updata note image diff --git a/common/component/src/main/ets/components/NoteContentCompPortrait.ets b/common/component/src/main/ets/components/NoteContentCompPortrait.ets index ca3ca38..58b9bbb 100644 --- a/common/component/src/main/ets/components/NoteContentCompPortrait.ets +++ b/common/component/src/main/ets/components/NoteContentCompPortrait.ets @@ -73,6 +73,10 @@ export struct NoteContentCompPortrait { callbackScheduledSave: (html) => { LogUtil.info(TAG, 'callbackScheduledSave') + if (this.selectedNoteData.content_text == html) { + LogUtil.info(TAG, 'callbackScheduledSave the same value return') + return; + } this.selectedNoteData.content_text = html this.selectedNoteData.modified_time = new Date().getTime() // updata note image