mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
This commit is contained in:
parent
be8102d9a9
commit
fd95ae295c
2 changed files with 5 additions and 2 deletions
|
|
@ -150,11 +150,14 @@ export const countSelectWord = (range: Range, rootID?: string) => {
|
|||
/// #endif
|
||||
};
|
||||
|
||||
export const countBlockWord = (ids: string[], rootID?: string) => {
|
||||
export const countBlockWord = (ids: string[], rootID?: string, clearCache = false) => {
|
||||
/// #if !MOBILE
|
||||
if (document.getElementById("status").classList.contains("fn__none")) {
|
||||
return;
|
||||
}
|
||||
if (clearCache) {
|
||||
countRootId = ""
|
||||
}
|
||||
if (ids.length > 0) {
|
||||
fetchPost("/api/block/getBlocksWordCount", {ids}, (response) => {
|
||||
renderStatusbarCounter(response.data);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ const promiseTransaction = () => {
|
|||
lockFile(protyle.block.rootID);
|
||||
return;
|
||||
}
|
||||
countBlockWord([], protyle.block.rootID);
|
||||
countBlockWord([], protyle.block.rootID, true);
|
||||
if (doOperations.length === 1 && (doOperations[0].action === "unfoldHeading" || doOperations[0].action === "foldHeading" || doOperations[0].action === "setAttrs")) {
|
||||
const gutterFoldElement = protyle.gutter.element.querySelector('[data-type="fold"]');
|
||||
if (gutterFoldElement) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue