diff --git a/manifest.json b/manifest.json index 7c35f40..18c5c76 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "co-intelligence", "name": "Co-Intelligence AI", - "version": "1.0.8", + "version": "1.0.9", "minAppVersion": "1.8.0", "description": "Co-Intelligence AI gives you a full AI chat experience in Obsidian.", "author": "Mike Thicke", diff --git a/src/ChatView.tsx b/src/ChatView.tsx index c810ff4..32fe5b7 100644 --- a/src/ChatView.tsx +++ b/src/ChatView.tsx @@ -51,12 +51,9 @@ export class ChatView extends TextFileView { this.handleChatChange = this.handleChatChange.bind(this); this.icon = "bot-message-square"; this.registerEvent( - this.app.workspace.on( - "co-intelligence:settings-changed" as any, - async () => { - await this.refresh(); - }, - ), + this.app.workspace.on("co-intelligence:settings-changed", async () => { + await this.refresh(); + }), ); } @@ -242,7 +239,7 @@ export class ChatView extends TextFileView { .setTitle("View as markdown") .setIcon("bot-message-square") .onClick(() => { - (this.app as any).commands.executeCommandById( + this.app.commands.executeCommandById( "co-intelligence:toggle-chat-view", ); }); diff --git a/src/CoIntelligencePlugin.tsx b/src/CoIntelligencePlugin.tsx index 0339299..ee6d3c2 100644 --- a/src/CoIntelligencePlugin.tsx +++ b/src/CoIntelligencePlugin.tsx @@ -54,16 +54,13 @@ export class CoIntelligencePlugin extends Plugin { createCOINote(this.app, this); }); this.registerEvent( - this.app.workspace.on("file-open" as any, this.handleFileOpen.bind(this)), + this.app.workspace.on("file-open", this.handleFileOpen.bind(this)), ); this.registerEvent( this.app.vault.on("rename", this.handleFileRename.bind(this)), ); this.registerEvent( - this.app.workspace.on( - "file-menu" as any, - this.onFileMenuHandler.bind(this) as any, - ), + this.app.workspace.on("file-menu", this.onFileMenuHandler.bind(this)), ); this.app.workspace.onLayoutReady(this.onloadOnLayoutReady.bind(this)); @@ -114,7 +111,7 @@ export class CoIntelligencePlugin extends Plugin { menu.addItem((item) => { item.setTitle("View as chat"); item.onClick(async () => { - (this.app as any).commands.executeCommandById( + this.app.commands.executeCommandById( "co-intelligence:toggle-chat-view", ); }); diff --git a/src/components/ChatInterface.tsx b/src/components/ChatInterface.tsx index 073ca36..0928584 100644 --- a/src/components/ChatInterface.tsx +++ b/src/components/ChatInterface.tsx @@ -287,7 +287,7 @@ export const ChatInterface = ({ } triggerChange(true); } catch (error) { - const message = (error as any).message || "Unknown error"; + const message = (error as Error).message || "Unknown error"; new Notice("Error generating response: " + message); console.error("Error generating response:", error); setIsProcessing(false); diff --git a/src/components/SystemPromptSelector.tsx b/src/components/SystemPromptSelector.tsx index 259bd65..5bfcee2 100644 --- a/src/components/SystemPromptSelector.tsx +++ b/src/components/SystemPromptSelector.tsx @@ -69,7 +69,7 @@ export const SystemPromptSelector: Component = ({ // Listen for settings changes if (app) { const eventRef = app.workspace.on( - "co-intelligence:settings-changed" as any, + "co-intelligence:settings-changed", loadPrompts, );