javalent / admonitions

Adds admonition block-styled content to Obsidian.md
MIT License
1.05k stars 67 forks source link

Minor Error in Console When Use CSS Snippet Enabled #267

Closed sigrunixia closed 1 year ago

sigrunixia commented 1 year ago

Parameters

When "Use CSS Snippet for Custom Callouts" is enabled, Admonitions will generate an error within Obsidian for each "Admonition" that is created.

Fix

Disable "Use CSS Snippet for Custom Callouts"

Negatives Observed

None have been observed.

Console Error

Uncaught (in promise) TypeError: this.plugin.app.customCss.readCssFolders is not a function at d2.updateSnippet (plugin:obsidian-admonition:479:1006)

cjolson commented 1 year ago

Also notice this. Adding a screenshot:

Screenshot 2022-11-16 at 8 48 21 AM
sigrunixia commented 1 year ago

Looks like this is still around. Here is the specific area its "crying about.

        async updateSnippet() {
            !this.plugin.data.useSnippet || (await this.plugin.app.vault.adapter.exists(this.snippetPath) ? await this.plugin.app.vault.adapter.write(this.snippetPath, this.generateCssString()) : await this.plugin.app.vault.create(this.snippetPath, this.generateCssString()),
            this.plugin.app.customCss.setCssEnabledStatus(this.plugin.data.snippetPath, !0),
            this.plugin.app.customCss.readCssFolders())
        }

The specific issue is .readCssFolders()). In main.ts, it is currently voided as a function.

valentine195 commented 1 year ago

Fixed in 9.2.2