fix(mobile): tree not closing after pressing menu item

This commit is contained in:
Elian Doran 2025-04-12 09:43:35 +03:00
parent e5f7b978e0
commit a8f1abb77f
No known key found for this signature in database
2 changed files with 8 additions and 1 deletions

View File

@ -6,7 +6,9 @@
## 🐞 Bugfixes
* Calendar does not hide when clicking on a note by @JYC333
* Mobile improvements:
* [Unable to add internal link on mobile version](https://github.com/TriliumNext/Notes/issues/1677)
* Note tree not closing when selecting some of the menu actions.
## ✨ Improvements

View File

@ -12,6 +12,7 @@ import { t } from "../services/i18n.js";
import type NoteTreeWidget from "../widgets/note_tree.js";
import type FAttachment from "../entities/fattachment.js";
import type { SelectMenuItemEventListener } from "../components/events.js";
import utils from "../services/utils.js";
// TODO: Deduplicate once client/server is well split.
interface ConvertToAttachmentResponse {
@ -204,6 +205,10 @@ export default class TreeContextMenu implements SelectMenuItemEventListener<Tree
async selectMenuItemHandler({ command, type, templateNoteId }: MenuCommandItem<TreeCommandNames>) {
const notePath = treeService.getNotePath(this.node);
if (utils.isMobile()) {
this.treeWidget.triggerCommand("setActiveScreen", { screen: "detail" });
}
if (command === "openInTab") {
appContext.tabManager.openTabWithNoteWithHoisting(notePath);
} else if (command === "insertNoteAfter") {