Fixed bug where it was conflicting with https://github.com/pjeby/hotkey-helper plugin.

This commit is contained in:
Andrea Alberti 2024-10-19 21:27:50 +02:00
parent 2cf1a9249b
commit bdc60e6c1f
3 changed files with 9 additions and 7 deletions

View file

@ -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"),

View file

@ -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",

View file

@ -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);
};
},
/*