diff --git a/esbuild.config.mjs b/esbuild.config.mjs index 1f05f98..4842e07 100644 --- a/esbuild.config.mjs +++ b/esbuild.config.mjs @@ -43,10 +43,10 @@ const context = await esbuild.context({ target: "es2022", logLevel: "info", sourcemap: prod ? false : "inline", - // minify: prod, - // minifySyntax: prod, // Enable syntax minification in production - // minifyWhitespace: prod, // Disable whitespace minification - // minifyIdentifiers: prod, // Disable identifier minification + minify: prod, + minifySyntax: prod, // Enable syntax minification in production + minifyWhitespace: prod, // Disable whitespace minification + minifyIdentifiers: prod, // Disable identifier minification outdir, define: { "process.env.NODE_ENV": JSON.stringify(prod ? "production" : "development"), diff --git a/manifest.json b/manifest.json index 57764fb..bca23d5 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "plugins-annotations", "name": "Plugins Annotations", - "version": "1.7.4", + "version": "1.7.5", "minAppVersion": "1.5.0", "description": "Allows adding personal comments to each installed plugin.", "author": "Andrea Alberti", diff --git a/src/main.ts b/src/main.ts index 18fa507..156b085 100644 --- a/src/main.ts +++ b/src/main.ts @@ -393,6 +393,8 @@ export default class PluginsAnnotations extends Plugin { // Patch openTab to detect when a tab is opened const removeMonkeyPatchForSetting = around(this.app.setting, { + // Important: keep openTab as regular function and do not make it async because + // it would break its contract with the other parts of Obsidian and other plugins openTab: (next: (tab: SettingTab) => void) => { return function(this: Setting, tab: SettingTab) { if (tab && tab.id === 'community-plugins') { @@ -405,10 +407,10 @@ export default class PluginsAnnotations extends Plugin { }).catch(err => { console.error("Error observing community plugins tab: ", err); }); + return; } - } else { - next.call(this, tab); } + next.call(this, tab); }; }, /*