chore(client/ts): port components/app_context

This commit is contained in:
Elian Doran
2024-12-23 14:10:57 +02:00
parent 838dc521b1
commit ec685db093
4 changed files with 56 additions and 29 deletions

View File

@@ -1,6 +1,6 @@
import treeService from './tree.js';
import linkContextMenuService from "../menus/link_context_menu.js";
import appContext from "../components/app_context.js";
import appContext, { NoteCommandData } from "../components/app_context.js";
import froca from "./froca.js";
import utils from "./utils.js";
@@ -141,14 +141,7 @@ async function createLink(notePath: string, options: CreateLinkOptions = {}) {
return $container;
}
interface CalculateHashOpts {
notePath: string;
ntxId?: string;
hoistedNoteId?: string;
viewScope: ViewScope;
}
function calculateHash({notePath, ntxId, hoistedNoteId, viewScope = {}}: CalculateHashOpts) {
function calculateHash({notePath, ntxId, hoistedNoteId, viewScope = {}}: NoteCommandData) {
notePath = notePath || "";
const params = [
ntxId ? { ntxId: ntxId } : null,