mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +08:00
fix(build): tests failing due to cyclic dependencies
This commit is contained in:
parent
07dbacb61f
commit
15075c8626
@ -1,7 +1,6 @@
|
|||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { Modal } from "bootstrap";
|
import { Modal } from "bootstrap";
|
||||||
import type { ViewScope } from "./link.js";
|
import type { ViewScope } from "./link.js";
|
||||||
import appContext from "../components/app_context.js";
|
|
||||||
|
|
||||||
function reloadFrontendApp(reason?: string) {
|
function reloadFrontendApp(reason?: string) {
|
||||||
if (reason) {
|
if (reason) {
|
||||||
@ -403,13 +402,15 @@ function openHelp($button: JQuery<HTMLElement>) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function openInAppHelp($button: JQuery<HTMLElement>) {
|
async function openInAppHelp($button: JQuery<HTMLElement>) {
|
||||||
if ($button.length === 0) {
|
if ($button.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const inAppHelpPage = $button.attr("data-in-app-help");
|
const inAppHelpPage = $button.attr("data-in-app-help");
|
||||||
if (inAppHelpPage) {
|
if (inAppHelpPage) {
|
||||||
|
// Dynamic import to avoid import issues in tests.
|
||||||
|
const appContext = (await import("../components/app_context.js")).default;
|
||||||
const subContexts = appContext.tabManager.getActiveContext().getSubContexts();
|
const subContexts = appContext.tabManager.getActiveContext().getSubContexts();
|
||||||
const targetNote = `_help_${inAppHelpPage}`;
|
const targetNote = `_help_${inAppHelpPage}`;
|
||||||
const helpSubcontext = subContexts.find((s) => s.viewScope?.viewMode === "contextual-help");
|
const helpSubcontext = subContexts.find((s) => s.viewScope?.viewMode === "contextual-help");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user