- Fixed bug where a warning was shown when a new plugin was installed.

This commit is contained in:
Andrea Alberti 2024-10-18 22:11:30 +02:00
parent f1b9ac1d77
commit 854549a38c
2 changed files with 7 additions and 2 deletions

View file

@ -432,6 +432,12 @@ export default class PluginsAnnotations extends Plugin {
}
};
},
installPlugin: (next: (repo: string, version: string, manifest: PluginManifest) => Promise<void>) => {
return async function (this: Plugins, repo: string, version: string, manifest: PluginManifest): Promise<void> {
await next.call(this, repo, version, manifest);
self.pluginNameToIdMap[manifest.name] = manifest.id;
};
},
});
// Register the patch to ensure it gets cleaned up
@ -488,8 +494,6 @@ export default class PluginsAnnotations extends Plugin {
async observeCommunityPluginsTab(tab: SettingTab) {
console.log("CALLED");
// just in case, remove previous observers if there are any
this.disconnectObservers();

View file

@ -58,6 +58,7 @@ declare module "obsidian" {
plugins: Record<string, Plugin>;
getPlugin(id: string): Plugin;
uninstallPlugin(pluginId: string): Promise<void>;
installPlugin(repo: string, version: string, manifest: PluginManifest): Promise<void>
}
interface InternalPlugins {