This commit is contained in:
Vanessa 2022-10-07 22:25:03 +08:00
parent be8102d9a9
commit fd95ae295c
2 changed files with 5 additions and 2 deletions

View file

@ -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);

View file

@ -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) {