From 97a4325684442fbb7c3f2fdaa255565d068fc5c5 Mon Sep 17 00:00:00 2001 From: Brandon Boswell Date: Mon, 31 Jul 2023 11:19:15 -0400 Subject: [PATCH] Updates based on Review Feedback --- manifest.json | 2 +- src/ReflectionDay.svelte | 4 ++-- src/main.ts | 12 ++---------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/manifest.json b/manifest.json index 7ad0907..d25736e 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "name": "Reflection", "version": "1.0.0", "minAppVersion": "0.15.0", - "description": "An Obsidian Plugin for seeing daily and weekly notes from this day in years past.", + "description": "Shows daily and weekly notes from this day in years past.", "author": "Brandon Boswell", "authorUrl": "https://brandonkboswell.com/", "fundingUrl": "https://link.brandonkboswell.com/coffee", diff --git a/src/ReflectionDay.svelte b/src/ReflectionDay.svelte index cda83a5..947f53c 100644 --- a/src/ReflectionDay.svelte +++ b/src/ReflectionDay.svelte @@ -19,7 +19,7 @@ try { await MarkdownRenderer.renderMarkdown(markdown, markdownRenderWrapper, currentFile, view); } catch (error) { - console.log('Markdown Error', error) + // Likely Markdown Error from other plugins } title = file.basename; content = markdownRenderWrapper.innerHTML; @@ -119,4 +119,4 @@ cursor: pointer; } } - \ No newline at end of file + diff --git a/src/main.ts b/src/main.ts index ed57ac0..dd67787 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,4 @@ -import { Plugin, Keymap } from 'obsidian'; +import { Plugin, Keymap, moment } from 'obsidian'; import ReflectionSection from "./ReflectionSection.svelte"; import { getAllDailyNotes, @@ -25,7 +25,6 @@ let reflectionClass = "reflection-container" let leafRegistry = {} function removeElementsByClass(domNodeToSearch, className){ - console.log('Removing', domNodeToSearch, className) const elements = domNodeToSearch.getElementsByClassName(className); while(elements.length > 0){ elements[0].parentNode.removeChild(elements[0]); @@ -41,7 +40,6 @@ export default class Reflection extends Plugin { async runOnLeaf(leaf) { if (!this.ready) { - console.log('Not Ready, Re-initing'); await this.init(); } @@ -62,12 +60,10 @@ export default class Reflection extends Plugin { handleRegisterEvents() { this.registerEvent(this.app.workspace.on('active-leaf-change', async (leaf) => { - console.log('active-leaf-change', leaf); this.runOnLeaf(leaf); })); this.registerEvent(this.app.workspace.on('window-open', async () => { - console.log('window-open'); this.updateAllLeaves(); })); } @@ -237,18 +233,14 @@ export default class Reflection extends Plugin { } async init() { - console.log('Loading Reflection Plugin'); - // Sometimes this loads before the dependencies are ready // This stops that from throwing an unncessary error try { await this.establishNoteCaches(); await this.gatherPeriodicNoteSettings(); this.ready = true; - - console.log('Reflection is ready') } catch(e) { - console.log('Dependencies not yet ready', e); + // Dependencies not yet ready } }