mirror of
https://github.com/zachatoo/obsidian-css-editor.git
synced 2026-07-22 08:10:27 +00:00
Remove unnecessary api version check
minAppVersion in the manifest.json is above the version we're checking for
This commit is contained in:
parent
7aa1083b78
commit
7d2f36164d
1 changed files with 2 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { requireApiVersion, ViewState, Workspace } from "obsidian";
|
||||
import { ViewState, Workspace } from "obsidian";
|
||||
import { CssFile } from "src/CssFile";
|
||||
import { VIEW_TYPE_CSS } from "src/views/CssEditorView";
|
||||
|
||||
|
|
@ -19,9 +19,7 @@ export async function openView(
|
|||
export async function detachCssFileLeaves(workspace: Workspace, file: CssFile) {
|
||||
const leaves = workspace.getLeavesOfType(VIEW_TYPE_CSS);
|
||||
for (const leaf of leaves) {
|
||||
if (requireApiVersion("1.7.2")) {
|
||||
await leaf.loadIfDeferred();
|
||||
}
|
||||
await leaf.loadIfDeferred();
|
||||
if (leaf.getViewState().state?.file === file.name) {
|
||||
leaf.detach();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue