mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 12:56:01 -06:00
fix(ui): publish mobile setup independently (#100179)
* fix(ui): publish mobile setup independently * fix(ui): publish mobile setup independently
This commit is contained in:
committed by
GitHub
parent
e1eac7a79d
commit
86bf85fb35
@@ -620,9 +620,10 @@ export function createApplicationOverlays(gateway: ApplicationGateway): Applicat
|
||||
}
|
||||
devicePairSetupState.pendingCount = 0;
|
||||
const setupOperation = openDevicePairSetupState(devicePairSetupState);
|
||||
const pendingCountOperation = refreshDevicePairPendingCount();
|
||||
// Pairing-list latency must not keep a ready setup code behind the loading state.
|
||||
void refreshDevicePairPendingCount();
|
||||
publish();
|
||||
await Promise.all([setupOperation, pendingCountOperation]);
|
||||
await setupOperation;
|
||||
if (!disposed) {
|
||||
publish();
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ describeControlUiE2e("Control UI mobile pairing mocked Gateway E2E", () => {
|
||||
const sidebarPairingButton = page.locator(".sidebar-pair-mobile");
|
||||
await sidebarPairingButton.waitFor();
|
||||
await expect.poll(async () => sidebarPairingButton.isEnabled()).toBe(true);
|
||||
await gateway.deferNext("device.pair.list");
|
||||
await sidebarPairingButton.click();
|
||||
|
||||
const dialog = page.getByRole("dialog", { name: "OpenClaw mobile" });
|
||||
@@ -88,8 +89,15 @@ describeControlUiE2e("Control UI mobile pairing mocked Gateway E2E", () => {
|
||||
);
|
||||
expect(
|
||||
await page.getByText("Official OpenClaw mobile apps connect automatically").isVisible(),
|
||||
).toBe(false);
|
||||
).toBe(true);
|
||||
await gateway.resolveDeferred("device.pair.list", {
|
||||
paired: [],
|
||||
pending: [{ deviceId: "mobile-1", requestId: "request-1" }],
|
||||
});
|
||||
expect(await page.getByText("Device requests waiting for review: 1").isVisible()).toBe(true);
|
||||
expect(
|
||||
await page.getByText("Official OpenClaw mobile apps connect automatically").isVisible(),
|
||||
).toBe(false);
|
||||
|
||||
const firstRequest = await gateway.waitForRequest("device.pair.setupCode");
|
||||
expect(firstRequest.params).toEqual({});
|
||||
|
||||
Reference in New Issue
Block a user