mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 12:17:40 +00:00
refactor(gateway): split server runtime
This commit is contained in:
16
src/gateway/server-mobile-nodes.ts
Normal file
16
src/gateway/server-mobile-nodes.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
type BridgeLike = {
|
||||
listConnected?: () => Array<{ platform?: string | null }>;
|
||||
};
|
||||
|
||||
const isMobilePlatform = (platform: unknown): boolean => {
|
||||
const p = typeof platform === "string" ? platform.trim().toLowerCase() : "";
|
||||
if (!p) return false;
|
||||
return (
|
||||
p.startsWith("ios") || p.startsWith("ipados") || p.startsWith("android")
|
||||
);
|
||||
};
|
||||
|
||||
export function hasConnectedMobileNode(bridge: BridgeLike | null): boolean {
|
||||
const connected = bridge?.listConnected?.() ?? [];
|
||||
return connected.some((n) => isMobilePlatform(n.platform));
|
||||
}
|
||||
Reference in New Issue
Block a user