The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 25, 18:30 UTC
Prevent config refetches and tighten Windows platform detection
- set server config query `staleTime` to `Infinity` to avoid unnecessary refetches - narrow `isWindowsPlatform` matching to Windows-prefixed identifiers - add unit tests for Windows and non-Windows platform cases
Julius Marminge committed
Feb 15, 2026 at 15:33 UTC
8dd107429e92dfcb52d8afb46e2a01517840fabc
3 files changed
+17
-1
apps/web/src/lib/serverReactQuery.ts
+1
@@ -16,5 +16,6 @@ export function serverConfigQueryOptions(api: NativeApi | undefined) {
16
return api.server.getConfig();
17
},
18
enabled: !!api && !!api.server && typeof api.server.getConfig === "function",
19
+ staleTime: Infinity,
20
});
21
}
apps/web/src/lib/utils.test.ts
new
+15
@@ -0,0 +1,15 @@
1
+import { assert, describe, it } from "vitest";
2
+
3
+import { isWindowsPlatform } from "./utils";
4
+
5
+describe("isWindowsPlatform", () => {
6
+ it("matches Windows platform identifiers", () => {
7
+ assert.isTrue(isWindowsPlatform("Win32"));
8
+ assert.isTrue(isWindowsPlatform("Windows"));
9
+ assert.isTrue(isWindowsPlatform("windows_nt"));
10
+ });
11
+
12
+ it("does not match darwin", () => {
13
+ assert.isFalse(isWindowsPlatform("darwin"));
14
+ });
15
+});
apps/web/src/lib/utils.ts
+1
-1
@@ -10,5 +10,5 @@ export function isMacPlatform(platform: string): boolean {
10
}
11
12
export function isWindowsPlatform(platform: string): boolean {
13
- return /win|windows/i.test(platform);
13
+ return /^win(dows)?/i.test(platform);
14
}