mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
fix(control-ui): send stable websocket instance IDs (#23616)
Co-authored-by: zq58855371-ui <248869919+zq58855371-ui@users.noreply.github.com>
This commit is contained in:
@@ -70,6 +70,7 @@ function createHost() {
|
||||
navGroupsCollapsed: {},
|
||||
},
|
||||
password: "",
|
||||
clientInstanceId: "instance-test",
|
||||
client: null,
|
||||
connected: false,
|
||||
hello: null,
|
||||
|
||||
@@ -46,6 +46,7 @@ import type {
|
||||
type GatewayHost = {
|
||||
settings: UiSettings;
|
||||
password: string;
|
||||
clientInstanceId: string;
|
||||
client: GatewayBrowserClient | null;
|
||||
connected: boolean;
|
||||
hello: GatewayHelloOk | null;
|
||||
@@ -147,6 +148,7 @@ export function connectGateway(host: GatewayHost) {
|
||||
password: host.password.trim() ? host.password : undefined,
|
||||
clientName: "openclaw-control-ui",
|
||||
mode: "webchat",
|
||||
instanceId: host.clientInstanceId,
|
||||
onHello: (hello) => {
|
||||
if (host.client !== client) {
|
||||
return;
|
||||
|
||||
@@ -81,6 +81,7 @@ import type {
|
||||
NostrProfile,
|
||||
} from "./types.ts";
|
||||
import { type ChatAttachment, type ChatQueueItem, type CronFormState } from "./ui-types.ts";
|
||||
import { generateUUID } from "./uuid.ts";
|
||||
import type { NostrProfileFormState } from "./views/channels.nostr-profile-form.ts";
|
||||
|
||||
declare global {
|
||||
@@ -107,6 +108,7 @@ function resolveOnboardingMode(): boolean {
|
||||
@customElement("openclaw-app")
|
||||
export class OpenClawApp extends LitElement {
|
||||
private i18nController = new I18nController(this);
|
||||
clientInstanceId = generateUUID();
|
||||
@state() settings: UiSettings = loadSettings();
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
Reference in New Issue
Block a user