refactor: 💡 Fix ts error

This commit is contained in:
Jin
2025-03-18 18:44:48 +01:00
parent e12be14dc9
commit b18cfb5d20
5 changed files with 27 additions and 8 deletions

View File

@@ -411,7 +411,11 @@ async function openInAppHelp($button: JQuery<HTMLElement>) {
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 activeContext = appContext.tabManager.getActiveContext();
if (!activeContext) {
return;
}
const subContexts = activeContext.getSubContexts();
const targetNote = `_help_${inAppHelpPage}`;
const helpSubcontext = subContexts.find((s) => s.viewScope?.viewMode === "contextual-help");
const viewScope: ViewScope = {