mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 11:55:47 -06:00
5d80b62d21
* fix(ui): nudge stale tabs after gateway updates * fix(ui): resolve external packages in worktrees
24 lines
1005 B
TypeScript
24 lines
1005 B
TypeScript
// Compile-time identity for the Control UI artifact.
|
|
import { normalizeControlUiBuildInfo } from "./build-info-normalizers.ts";
|
|
import type { ControlUiBuildInfo } from "./build-info-types.ts";
|
|
|
|
export type { ControlUiBuildInfo } from "./build-info-types.ts";
|
|
|
|
declare global {
|
|
// Vite replaces this property with one object so the UI and service worker
|
|
// share the exact artifact identity without separate compile-time constants.
|
|
var OPENCLAW_CONTROL_UI_BUILD_INFO: ControlUiBuildInfo | undefined;
|
|
}
|
|
|
|
const injectedBuildInfo = globalThis.OPENCLAW_CONTROL_UI_BUILD_INFO;
|
|
|
|
export const CONTROL_UI_BUILD_INFO = normalizeControlUiBuildInfo(injectedBuildInfo);
|
|
|
|
export function controlUiVersionDiffersFrom(gatewayVersion: string | undefined): boolean {
|
|
const controlUiVersion = CONTROL_UI_BUILD_INFO.version?.trim();
|
|
const normalizedGatewayVersion = gatewayVersion?.trim();
|
|
return Boolean(
|
|
controlUiVersion && normalizedGatewayVersion && controlUiVersion !== normalizedGatewayVersion,
|
|
);
|
|
}
|