mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
fix(llm): button shown even if disabled
This commit is contained in:
parent
e4af99bfd4
commit
b93e44a38f
@ -1,27 +0,0 @@
|
|||||||
import { t } from "../../services/i18n.js";
|
|
||||||
import options from "../../services/options.js";
|
|
||||||
import CommandButtonWidget from "./command_button.js";
|
|
||||||
|
|
||||||
export default class CreateAiChatButton extends CommandButtonWidget {
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
this.icon("bx bx-bot")
|
|
||||||
.title(t("ai.create_new_ai_chat"))
|
|
||||||
.titlePlacement("bottom")
|
|
||||||
.command("createAiChat")
|
|
||||||
.class("icon-action");
|
|
||||||
}
|
|
||||||
|
|
||||||
isEnabled() {
|
|
||||||
return options.get("aiEnabled") === "true";
|
|
||||||
}
|
|
||||||
|
|
||||||
async refreshWithNote() {
|
|
||||||
if (this.isEnabled()) {
|
|
||||||
this.$widget.show();
|
|
||||||
} else {
|
|
||||||
this.$widget.hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -72,7 +72,7 @@ export default function buildLaunchBarConfig() {
|
|||||||
id: "_lbLlmChat",
|
id: "_lbLlmChat",
|
||||||
title: t("hidden-subtree.llm-chat-title"),
|
title: t("hidden-subtree.llm-chat-title"),
|
||||||
type: "launcher",
|
type: "launcher",
|
||||||
command: "createAiChat",
|
builtinWidget: "aiChatLauncher",
|
||||||
icon: "bx bx-bot",
|
icon: "bx bx-bot",
|
||||||
attributes: [
|
attributes: [
|
||||||
{ type: "label", name: "desktopOnly" }
|
{ type: "label", name: "desktopOnly" }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user