Skip to content

Commit

Permalink
Fix/better weekly note handling (#152)
Browse files Browse the repository at this point in the history
* Fix: better weekly note handling; fix delete notes

* Remove console.log

* Bump version 1.5.4
  • Loading branch information
liamcain committed Mar 15, 2021
1 parent b795a60 commit 9463a0a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 28 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "calendar",
"name": "Calendar",
"description": "Calendar view of your daily notes",
"version": "1.5.3",
"version": "1.5.4",
"author": "Liam Cain",
"authorUrl": "https://github.com/liamcain/",
"isDesktopOnly": false,
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "calendar",
"version": "1.5.3",
"version": "1.5.4",
"description": "Calendar view of your daily notes",
"author": "liamcain",
"main": "main.js",
Expand All @@ -13,9 +13,9 @@
},
"dependencies": {
"obsidian": "obsidianmd/obsidian-api#master",
"obsidian-calendar-ui": "0.3.4",
"obsidian-daily-notes-interface": "0.7.3",
"svelte": "3.32.3",
"obsidian-calendar-ui": "0.3.5",
"obsidian-daily-notes-interface": "0.7.6",
"svelte": "3.35.0",
"tslib": "2.1.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const defaultSettings = Object.freeze({
localeOverride: "system-default",
});

export function appHasPeriodicNotesPluginLoaded() {
export function appHasPeriodicNotesPluginLoaded(): boolean {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const periodicNotes = (<any>window.app).plugins.getPlugin("periodic-notes");
return periodicNotes && periodicNotes.settings?.weekly?.enabled;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/fileMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function showFileMenu(app: App, file: TFile, position: Point): void {
.setIcon("trash")
.onClick(() => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(<any>app).fileManager.promptForFolderDeletion(file);
(<any>app).fileManager.promptForFileDeletion(file);
})
);

Expand Down
4 changes: 3 additions & 1 deletion src/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,12 @@ export default class CalendarView extends ItemView {
return;
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const mode = (this.app.vault as any).getConfig("defaultViewMode");
const leaf = inNewSplit
? workspace.splitActiveLeaf()
: workspace.getUnpinnedLeaf();
await leaf.openFile(existingFile);
await leaf.openFile(existingFile, { mode });

activeFile.setFile(existingFile);
}
Expand Down
35 changes: 15 additions & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3308,22 +3308,22 @@ object.pick@^1.3.0:
dependencies:
isobject "^3.0.1"

obsidian-calendar-ui@0.3.4:
version "0.3.4"
resolved "https://registry.yarnpkg.com/obsidian-calendar-ui/-/obsidian-calendar-ui-0.3.4.tgz#7115e3ab53d308a28720b54e548a1c9975e7b134"
integrity sha512-6tMLO+weEJUz6AIsPuAT05ktXkgrMwqASDLWbuJYn8TwRqYbMlHC85UybonsDk+TC4zlXFyfXEBBOgHCPAHgzw==
obsidian-calendar-ui@0.3.5:
version "0.3.5"
resolved "https://registry.yarnpkg.com/obsidian-calendar-ui/-/obsidian-calendar-ui-0.3.5.tgz#d4a9090d828e7f8f05189567bfc4a942fea4e288"
integrity sha512-+zO7cqr2qA0f7vfIL680YexztVbERQLv3axRJ+HsjdveaelJVQDNXH0sJcfQrMfOZuGZgHpN48fFEr9R2reeQg==
dependencies:
obsidian-daily-notes-interface "0.7.3"
svelte "3.32.3"
obsidian-daily-notes-interface "0.7.6"
svelte "3.35.0"
tslib "2.1.0"

obsidian-daily-notes-interface@0.7.3:
version "0.7.3"
resolved "https://registry.yarnpkg.com/obsidian-daily-notes-interface/-/obsidian-daily-notes-interface-0.7.3.tgz#48b8917f23aa2534cf4516246a793f44a2e119e8"
integrity sha512-SbaguZ9+qPjiX/VAxONls78ji2hEMALTR3bqmifzLtZf+xUOf7jMvtCsGK7KG4zDMLlpkPT/RnbCenXKvWnbVA==
obsidian-daily-notes-interface@0.7.6:
version "0.7.6"
resolved "https://registry.yarnpkg.com/obsidian-daily-notes-interface/-/obsidian-daily-notes-interface-0.7.6.tgz#2161cff49ddcdcf14aafce5fc660c4efe1d73b4a"
integrity sha512-b9MITVljqYZlbvTbhFZ3td/Nmmg9sFaGCn7QGNRj0XPrPhOUUt6iPKJqjfPPstNtqRgc1ufUZdRXxlsJu0grWQ==
dependencies:
obsidian obsidianmd/obsidian-api#master
tslib "2.0.3"
tslib "2.1.0"

"obsidian@github:obsidianmd/obsidian-api#master":
version "0.11.0"
Expand Down Expand Up @@ -4157,10 +4157,10 @@ svelte-preprocess@^4.0.0:
detect-indent "^6.0.0"
strip-indent "^3.0.0"

svelte@3.32.3:
version "3.32.3"
resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.32.3.tgz#db0c50c65573ecffe4e2f4924e4862d8f9feda74"
integrity sha512-5etu/wDwtewhnYO/631KKTjSmFrKohFLWNm1sWErVHXqGZ8eJLqrW0qivDSyYTcN8GbUqsR4LkIhftNFsjNehg==
svelte@3.35.0:
version "3.35.0"
resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.35.0.tgz#e0d0ba60c4852181c2b4fd851194be6fda493e65"
integrity sha512-gknlZkR2sXheu/X+B7dDImwANVvK1R0QGQLd8CNIfxxGPeXBmePnxfzb6fWwTQRsYQG7lYkZXvpXJvxvpsoB7g==

symbol-tree@^3.2.4:
version "3.2.4"
Expand Down Expand Up @@ -4287,11 +4287,6 @@ ts-jest@26.5.1:
semver "7.x"
yargs-parser "20.x"

tslib@2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c"
integrity sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==

tslib@2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a"
Expand Down

0 comments on commit 9463a0a

Please sign in to comment.