From e050f760deaa7ea1ff00c075e664a2af47b38623 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Mon, 29 Apr 2024 16:30:46 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20OCR=20=E6=9C=AA=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E4=BF=9D=E5=AD=98=20ocr-texts.json=20https:/?= =?UTF-8?q?/github.com/siyuan-note/siyuan/issues/11171?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/util/ocr.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/util/ocr.go b/kernel/util/ocr.go index b9598a7bc..8d280cc4e 100644 --- a/kernel/util/ocr.go +++ b/kernel/util/ocr.go @@ -132,10 +132,12 @@ func SaveAssetsTexts() { } func SetAssetText(asset, text string) { + var oldText string assetsTextsLock.Lock() + oldText = assetsTexts[asset] assetsTexts[asset] = text assetsTextsLock.Unlock() - if "" != text { + if oldText != text { assetsTextsChanged.Store(true) } }