Skip to content

Commit

Permalink
add msg
Browse files Browse the repository at this point in the history
  • Loading branch information
008 committed Nov 16, 2023
1 parent 02348fd commit 4a1378b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Progressive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,12 +540,20 @@ class HeadingGroup {
}

async function getDocWordCount(docID: string): Promise<WordCountType[]> {
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;
}

Expand Down

0 comments on commit 4a1378b

Please sign in to comment.