mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	feat(llm): show/hide LLM button based on setting
This commit is contained in:
		| @@ -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(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user