Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Prevent repeated mobile breadcrumb menu activation https://github.com/siyuan-note/siyuan/issues/18919

Daniel75f2bc637d4d
diff --git a/app/src/protyle/breadcrumb/index.ts b/app/src/protyle/breadcrumb/index.ts
index 8d004c2581..a1b2549f89 100644
--- a/app/src/protyle/breadcrumb/index.ts
+++ b/app/src/protyle/breadcrumb/index.ts
@@ -56,6 +56,7 @@ export class Breadcrumb {
private uploadingRecordFiles = new Set<File>();
private startingRecord = false;
private stoppingRecord = false;
+ private mobileMenuLoading = false;
private previousFocusElement: HTMLElement;
private previousRange: Range;
@@ -591,10 +592,13 @@ ${padHTML}
}
private genMobileMenu(protyle: IProtyle) {
- if (protyle.toolbar.isMultiSelectMode()) {
+ if (protyle.toolbar.isMultiSelectMode() || this.mobileMenuLoading) {
return;
}
const menu = new Menu(Constants.MENU_BREADCRUMB_MOBILE_PATH);
+ if (menu.isOpen) {
+ return;
+ }
let blockElement: Element;
if (getSelection().rangeCount > 0) {
const range = getSelection().getRangeAt(0);
@@ -615,6 +619,7 @@ ${padHTML}
if (isEncryptedBox(protyle.notebookId)) {
breadcrumbParam.notebook = protyle.notebookId;
}
+ this.mobileMenuLoading = true;
fetchPost("/api/block/getBlockBreadcrumb", breadcrumbParam, (response) => {
response.data.forEach((item: IBreadcrumb) => {
let isCurrent = false;
@@ -633,6 +638,8 @@ ${padHTML}
});
});
menu.fullscreen();
+ }).finally(() => {
+ this.mobileMenuLoading = false;
});
}