Skip to content

Commit

Permalink
Address comments and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewturk committed Feb 29, 2024
1 parent 1b0d21c commit fcb83f0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Add a context-dependent sidecar panel.",
"author": "Matthew Turk",
"authorUrl": "https://matthewturk.github.io/",
"version": "0.2.2",
"version": "0.2.3",
"minAppVersion": "0.15.0",
"isDesktopOnly": false
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sidecar-panel",
"private": true,
"version": "0.2.2",
"version": "0.2.3",
"main": "main.js",
"type": "module",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions public/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
"0.2.0": "0.15.0",
"0.2.1": "0.15.0",
"0.2.2": "0.15.0",
"0.2.3": "0.15.0"
}
2 changes: 1 addition & 1 deletion src/components/ContextualSidecarPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
async function updateSidecarPanel(file: TFile | null) {
if (!file) return;
if (destination) destination.innerHTML = "";
if (destination) destination.empty();
let cache = app.metadataCache.getFileCache(file);
if (cache) {
Expand Down
18 changes: 9 additions & 9 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ export default class ContextualSidecarPanel extends Plugin {
}

async activateView() {
this.app.workspace.detachLeavesOfType(VIEW_TYPE_CONTEXTUAL_SIDECAR);

await this.app.workspace.getRightLeaf(false).setViewState({
type: VIEW_TYPE_CONTEXTUAL_SIDECAR,
active: true,
});
if (
this.app.workspace.getLeavesOfType(VIEW_TYPE_CONTEXTUAL_SIDECAR).length >
0
) {
await this.app.workspace.getRightLeaf(false).setViewState({
type: VIEW_TYPE_CONTEXTUAL_SIDECAR,
active: true,
});
}

this.app.workspace.revealLeaf(
this.app.workspace.getLeavesOfType(VIEW_TYPE_CONTEXTUAL_SIDECAR)[0]
Expand All @@ -76,9 +79,6 @@ class ContextualSidecarPanelSettingTab extends PluginSettingTab {
display(): void {
let { containerEl } = this;
containerEl.empty();
containerEl.createEl("h2", {
text: "Settings for Contextual Sidecar Panel",
});

// Some of this logic was inspired by the bwydoogh/obsidian-force-view-mode-of-note plugin.

Expand Down

0 comments on commit fcb83f0

Please sign in to comment.