Skip to content

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

Keep the original wording on a remote server's page

Bugfixer 2a4ab999cc39a
diff --git a/src/components/PluginsPanel.test.ts b/src/components/PluginsPanel.test.ts
index 13de6efbd2..9773588339 100644
--- a/src/components/PluginsPanel.test.ts
+++ b/src/components/PluginsPanel.test.ts
@@ -339,10 +339,15 @@ describe("connected apps setup notice", () => {
describe("unreadable credential store notice", () => {
it("says This PC only for a Windows or Linux desktop's own store", () => {
- expect(staleNoticeKey("darwin", false)).toBe("connectors.stale");
- expect(staleNoticeKey("win32", false)).toBe("connectors.stalePc");
- expect(staleNoticeKey("linux", false)).toBe("connectors.stalePc");
- expect(staleNoticeKey(undefined, false)).toBe("connectors.stale");
- expect(staleNoticeKey("win32", true)).toBe("connectors.stale");
+ const own = { active: false };
+ expect(staleNoticeKey({ platform: "darwin", remoteClient: own })).toBe("connectors.stale");
+ expect(staleNoticeKey({ platform: "win32", remoteClient: own })).toBe("connectors.stalePc");
+ expect(staleNoticeKey({ platform: "linux", remoteClient: own })).toBe("connectors.stalePc");
+ expect(staleNoticeKey({ remoteClient: own })).toBe("connectors.stale");
+ expect(staleNoticeKey(undefined)).toBe("connectors.stale");
+ // A remote client shows the server's store, which may not be this PC.
+ expect(staleNoticeKey({ platform: "win32", remoteClient: { active: true } })).toBe("connectors.stale");
+ // A remote server's page in this desktop gets no remoteClient bridge: its store is the server's too.
+ expect(staleNoticeKey({ platform: "win32" })).toBe("connectors.stale");
});
});
diff --git a/src/components/PluginsPanel.tsx b/src/components/PluginsPanel.tsx
index 3fb9fe49f4..e37f52d58f 100644
--- a/src/components/PluginsPanel.tsx
+++ b/src/components/PluginsPanel.tsx
@@ -77,9 +77,12 @@ export function hasUsableConnectedApps(configured: boolean, phase: ConnectorInve
}
/** The unreadable-store notice says This PC on a Windows or Linux desktop's own store. A Mac, a remote server's store
- * and an unknown platform keep the Mac wording they always had. */
-export const staleNoticeKey = (platform: string | undefined, remoteClient: boolean): LocaleKey =>
- !remoteClient && (platform === "win32" || platform === "linux") ? "connectors.stalePc" : "connectors.stale";
+ * and an unknown platform keep the Mac wording they always had. A remote server's page gets no remoteClient bridge
+ * (the preload keeps it to this app's own page), and an active remote client shows the server's store. */
+export const staleNoticeKey = (bridge: { platform?: string; remoteClient?: { active?: boolean } } | undefined): LocaleKey =>
+ bridge?.remoteClient && bridge.remoteClient.active !== true && (bridge.platform === "win32" || bridge.platform === "linux")
+ ? "connectors.stalePc"
+ : "connectors.stale";
/** Whether a hosted app's card shows: it matches the search, and the filter is All, or Connected and it isn't known to be
* disconnected (unknown while its servers load). */
@@ -592,7 +595,7 @@ export function PluginsPanel() {
<div className="mb-3 flex items-start gap-2 rounded-xl bg-warning/10 px-3 py-2 text-[13px] text-warning">
<TriangleAlert size={14} className="mt-px shrink-0" />
<span>
- {t(staleNoticeKey(window.ogb?.platform, remoteClient))}
+ {t(staleNoticeKey(window.ogb))}
</span>
</div>
)}