Skip to content

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

Give a ready My Cloud its Files link again in Settings

aivsomkar5155688ba3d9
diff --git a/src/components/CloudAccountSettings.test.ts b/src/components/CloudAccountSettings.test.ts
index 098ee51504..bc2ec5cf95 100644
--- a/src/components/CloudAccountSettings.test.ts
+++ b/src/components/CloudAccountSettings.test.ts
@@ -278,6 +278,13 @@ it.each([
expect(html.includes("data-plan-open-cloud")).toBe(connectable);
expect(html).not.toContain("Could not complete this Cloud action");
});
+it("a ready Cloud keeps its link to Files, and a stopped one has none", async () => {
+ vi.stubGlobal("window", { ogb: { cloudAccount: { ...bridge, files: {} } } });
+ await ready({ ...pro, machine: { status: "ready", origin } });
+ all(render().html, ["data-plan-open-cloud", "Share folders with the Cloud in Files"]);
+ push({ ...pro, machine: { status: "stopped", origin } });
+ none(render().html, ["Share folders with the Cloud in Files"]);
+});
it("while the bots move to My Cloud, says how the move goes, with nothing to open or switch back to; Open the Cloud comes back after", async () => {
let move: unknown = { phase: "copy", chats: { done: 3, total: 12 } };
vi.stubGlobal("window", { ogb: { cloudAccount: bridge, cloudSendPage: { notice: vi.fn(async () => ({ ready: true, bots: [], move })), onNotice: vi.fn(() => () => {}), dismiss: vi.fn() } } });
diff --git a/src/components/CloudAccountSettings.tsx b/src/components/CloudAccountSettings.tsx
index b6cd9f0166..11a3c108f3 100644
--- a/src/components/CloudAccountSettings.tsx
+++ b/src/components/CloudAccountSettings.tsx
@@ -68,6 +68,7 @@ function cloudHomeCard({ machine, busy, failed, onConnect, trial = false, waking
return <div data-cloud-home={machine.status} data-cloud-team={team ? true : undefined} data-cloud-waking={waking ? true : undefined} className="contents">
<SettingsLinkRow title={label} subtitle={team?.name ? t("cloudHome.team.ready", { name: team.name }) : t("settings.plan.cloudReadyLine")}
value={t(waking ? "settings.plan.cloudWaking" : "settings.plan.cloudReady")} external onClick={() => { if (!busy) onConnect(); }} data={{ "data-plan-open-cloud": "" }} />
+ {!team && cloudFilesBridge() && <p className="px-4 pb-3"><OpenFilesButton label={t("cloudHome.filesLink")} className="text-[12px] leading-4 text-accent-text hover:underline" /></p>}
{failed && <p role="alert" className="px-4 pb-3 text-[12px] leading-4 text-danger">{t("cloudHome.connectFailed")}</p>}
</div>;
}
@@ -77,9 +78,7 @@ function cloudHomeCard({ machine, busy, failed, onConnect, trial = false, waking
{machine.status === "provisioning" && machine.setup && <CloudSetupSteps step={machine.setup.step} />}
{connectable && !team && cloudFilesBridge() && <OpenFilesButton label={t("cloudHome.filesLink")} className="text-[12px] leading-4 text-accent-text hover:underline" />}
{failed && !unreachable && <p role="alert" className="text-danger">{t("cloudHome.connectFailed")}</p>}
- </>}>
- {connectable && !moving && <button type="button" disabled={busy} className="ui-button" onClick={onConnect}>{label}</button>}
- </SettingRow>
+ </>}>{null}</SettingRow>
</div>;
}