Skip to content

Commit

Permalink
#6 - Fix issue causing wrong editor mode when note had other front ma…
Browse files Browse the repository at this point in the history
…tter keys
  • Loading branch information
bwydoogh committed Aug 26, 2021
1 parent 41f5ed0 commit a16a08c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class ViewModeByFrontmatterPlugin extends Plugin {
const fileCache = this.app.metadataCache.getFileCache(view.file);
const fileDeclaredUIMode = fileCache !== null && fileCache.frontmatter ? fileCache.frontmatter[this.OBSIDIAN_UI_MODE_KEY] : null;

if (null !== fileDeclaredUIMode) {
if (fileDeclaredUIMode) {
if (['source', 'preview', 'live'].includes(fileDeclaredUIMode)
&& view.getMode() !== fileDeclaredUIMode) {
let state = leaf.getViewState();
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-view-mode-by-frontmatter",
"name": "Force note view mode (preview, source) using front matter",
"version": "1.0.1",
"version": "1.0.2",
"minAppVersion": "0.9.12",
"description": "This plugin allows to force the view mode for a note by using front matter",
"author": "Benny Wydooghe",
Expand Down

0 comments on commit a16a08c

Please sign in to comment.