🎨 重建索引时清空 scroll

This commit is contained in:
Vanessa 2024-06-21 22:22:24 +08:00
parent 32413fa11c
commit f3b0ee51d5
3 changed files with 15 additions and 3 deletions

View file

@ -278,11 +278,21 @@ export const transactionError = () => {
/// #endif
});
btnsElement[1].addEventListener("click", () => {
fetchPost("/api/filetree/refreshFiletree", {});
refreshFileTree();
dialog.destroy();
});
};
export const refreshFileTree = (cb?:() => void) => {
window.siyuan.storage[Constants.LOCAL_FILEPOSITION] = {};
setStorageVal(Constants.LOCAL_FILEPOSITION, window.siyuan.storage[Constants.LOCAL_FILEPOSITION]);
fetchPost("/api/filetree/refreshFiletree", {}, () => {
if (cb) {
cb()
}
});
}
let statusTimeout: number;
export const progressStatus = (data: IWebSocketData) => {
const statusElement = document.querySelector("#status") as HTMLElement;