diff --git a/src/public/app/widgets/buttons/llm_chat_button.ts b/src/public/app/widgets/buttons/llm_chat_button.ts index ea1b9b24e..94afab977 100644 --- a/src/public/app/widgets/buttons/llm_chat_button.ts +++ b/src/public/app/widgets/buttons/llm_chat_button.ts @@ -1,4 +1,6 @@ +import type { EventData } from "../../components/app_context.js"; import type FNote from "../../entities/fnote.js"; +import options from "../../services/options.js"; import CommandButtonWidget from "./command_button.js"; export default class LlmChatButton extends CommandButtonWidget { @@ -12,4 +14,14 @@ export default class LlmChatButton extends CommandButtonWidget { .class("launcher-button"); } + isEnabled() { + return options.get("aiEnabled") === "true"; + } + + entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) { + if (loadResults.isOptionReloaded("aiEnabled")) { + this.refresh(); + } + } + }