Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Offer no Clear for a Gemini key saved elsewhere

Krishna Dobhal08f9ed2fda0d
diff --git a/src/components/DecisionModelSettings.test.ts b/src/components/DecisionModelSettings.test.ts
index 3800bc9a6c..5873dbc46a 100644
--- a/src/components/DecisionModelSettings.test.ts
+++ b/src/components/DecisionModelSettings.test.ts
@@ -199,6 +199,14 @@ describe("DecisionModelSettings", () => {
expect(view.test.props.disabled).toBe(false);
});
+ it("a Gemini key saved for speech or images is switchable here, but has no key to clear", () => {
+ fixture.config = status({ provider: "gemini", configured: true, enabled: false, jobs: { roomRouting: true } });
+ const view = render();
+ expect(view.master.props.disabled).toBe(false);
+ expect(view.save.props.disabled).toBe(true);
+ expect(view.html).not.toContain("Clear");
+ });
+
it("with an own key saved as well, shows Connected and offers Clear, as without Cloud Pro", () => {
fixture.config = status({ provider: "jev", configured: true, enabled: true, jobs: { roomRouting: true } });
const view = render();
diff --git a/src/components/DecisionModelSettings.tsx b/src/components/DecisionModelSettings.tsx
index b4ad69d1e0..191dd16731 100644
--- a/src/components/DecisionModelSettings.tsx
+++ b/src/components/DecisionModelSettings.tsx
@@ -158,7 +158,8 @@ export function DecisionModelSettings() {
const included = configured && decider?.included === true;
const usingShared = openrouter && configured && decider?.keySource === "shared";
const sharedKey = openrouter && decider?.sharedKey === true;
- const ownKey = configured && !included && !usingShared;
+ const borrowedGemini = configured && decider?.provider === "gemini";
+ const ownKey = configured && !included && !usingShared && !borrowedGemini;
const enabled = decider?.enabled ?? false;
const roomRouting = decider?.jobs.roomRouting ?? true;
const [value, setValue] = useState("");