From eecfe5f5af783a9abbec4f99e002f6a780dcd5f4 Mon Sep 17 00:00:00 2001 From: Ross Keenan Date: Sun, 17 Apr 2022 16:09:03 +0200 Subject: [PATCH] refactor: :fire: Remove old deprecation warning --- src/Views/TrailView.ts | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/Views/TrailView.ts b/src/Views/TrailView.ts index 745de919..ae478810 100644 --- a/src/Views/TrailView.ts +++ b/src/Views/TrailView.ts @@ -109,9 +109,12 @@ export async function drawTrail(plugin: BCPlugin): Promise { showPrevNext, showBCsInEditLPMode, } = settings; + db.start2G("drawTrail"); + const activeMDView = app.workspace.getActiveViewOfType(MarkdownView); const mode = activeMDView?.getMode(); + if ( !showBCs || !activeMDView || @@ -125,13 +128,7 @@ export async function drawTrail(plugin: BCPlugin): Promise { const { file } = activeMDView; const { frontmatter } = app.metadataCache.getFileCache(file) ?? {}; - // @ts-ignore - const { hideTrailField } = settings; - if (hideTrailField && frontmatter?.[hideTrailField]) { - new Notice( - `${file.basename} still uses an old frontmatter field to hide it's trail. This settings has been deprecated in favour of a standardised field: 'BC-hide-trail'. Please change it so that this note's trail is hidden again.` - ); - } + if (frontmatter?.[BC_HIDE_TRAIL] || frontmatter?.["kanban-plugin"]) { db.end2G(); return; @@ -146,8 +143,8 @@ export async function drawTrail(plugin: BCPlugin): Promise { const view = mode === "preview" ? activeMDView.previewMode.containerEl.querySelector( - "div.markdown-preview-view" - ) + "div.markdown-preview-view" + ) : activeMDView.contentEl.querySelector("div.markdown-source-view"); activeMDView.containerEl @@ -198,11 +195,10 @@ export async function drawTrail(plugin: BCPlugin): Promise { : "100%"; const trailDiv = createDiv({ - cls: `BC-trail ${ - respectReadableLineLength - ? "is-readable-line-width markdown-preview-sizer markdown-preview-section" - : "" - }`, + cls: `BC-trail ${respectReadableLineLength + ? "is-readable-line-width markdown-preview-sizer markdown-preview-section" + : "" + }`, attr: { style: (mode !== "preview" ? `max-width: ${max_width};` : "") +