From 49675fd728a20f320d829a2910e71e0980a881bd Mon Sep 17 00:00:00 2001 From: Brandon Boswell Date: Sun, 28 Jan 2024 13:47:03 -0500 Subject: [PATCH] Fix an issue with nested periodic note folder structures --- package-lock.json | 4 ++-- package.json | 2 +- src/main.ts | 14 +++++++------- versions.json | 3 ++- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5965253..b11eb5a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "last-time", - "version": "1.0.0", + "version": "1.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "last-time", - "version": "1.0.0", + "version": "1.0.2", "license": "MIT", "dependencies": { "obsidian-daily-notes-interface": "^0.9.4" diff --git a/package.json b/package.json index 26dda14..6a51d69 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "reflection", - "version": "1.0.0", + "version": "1.0.2", "description": "An Obsidian Plugin for seeing daily and weekly notes from this day in years past.", "main": "main.js", "scripts": { diff --git a/src/main.ts b/src/main.ts index 77dc921..51dac3e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -208,14 +208,14 @@ export default class Reflection extends Plugin { } getTypeOfFile(file) { - switch (file.parent.path) { - case periodicNotesSettings.daily.folder: - return "daily" - case periodicNotesSettings.weekly.folder: - return "weekly" - default: - return; + if (file.parent.path.includes(periodicNotesSettings.daily.folder)) { + return "daily" + } + + if (file.parent.path.includes(periodicNotesSettings.weekly.folder)) { + return "weekly" } + return; } async renderContent(view, file) { diff --git a/versions.json b/versions.json index a6d5a03..03d60fe 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,5 @@ { "1.0.0": "0.15.0", - "1.0.1": "0.15.0" + "1.0.1": "0.15.0", + "1.0.2": "0.15.0" } \ No newline at end of file