From 4a1378bef373218924d73196218b40c60bffef04 Mon Sep 17 00:00:00 2001 From: 008 <007> Date: Fri, 17 Nov 2023 02:07:51 +0800 Subject: [PATCH] add msg --- src/Progressive.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Progressive.ts b/src/Progressive.ts index a927b14..bc16d42 100644 --- a/src/Progressive.ts +++ b/src/Progressive.ts @@ -540,12 +540,20 @@ class HeadingGroup { } async function getDocWordCount(docID: string): Promise { + await siyuan.pushMsg("开始统计字数……"); + let iter = 0; const content = []; for (const { id, type } of await siyuan.getChildBlocks(docID)) { + // TODO: batch get counts const { wordCount } = await siyuan.getBlocksWordCount([id]); const count = wordCount; content.push({ id, count, type }); + ++iter; + if (iter % 200 == 0) { + await siyuan.pushMsg(`已经统计了${iter}个块……`, 3000); + } } + await siyuan.pushMsg("统计字数结束……"); return content; }