mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:20:43 +00:00
fix: avoid preview-only pairing approval hint (#69226)
This commit is contained in:
@@ -108,4 +108,19 @@ describe("overview view rendering", () => {
|
||||
);
|
||||
expect(container.textContent).toContain("openclaw devices approve req-123");
|
||||
});
|
||||
|
||||
it("does not suggest preview-only latest approval when the request id is absent", async () => {
|
||||
const container = document.createElement("div");
|
||||
const props = createOverviewProps({
|
||||
lastError: "scope upgrade pending approval",
|
||||
lastErrorCode: "PAIRING_REQUIRED",
|
||||
});
|
||||
|
||||
render(renderOverview(props), container);
|
||||
await Promise.resolve();
|
||||
|
||||
expect(container.textContent).toContain("Scope upgrade pending approval.");
|
||||
expect(container.textContent).toContain("openclaw devices list");
|
||||
expect(container.textContent).not.toContain("openclaw devices approve --latest");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -111,9 +111,6 @@ export function renderOverview(props: OverviewProps) {
|
||||
}
|
||||
const copy = PAIRING_HINT_COPY[pairingState.kind];
|
||||
const title = copy.titleKey ? t(copy.titleKey) : t("overview.pairing.hint");
|
||||
const approveCommand = pairingState.requestId
|
||||
? `openclaw devices approve ${pairingState.requestId}`
|
||||
: "openclaw devices approve --latest";
|
||||
return html`
|
||||
<div class="muted" style="margin-top: 8px">
|
||||
${title}
|
||||
@@ -121,7 +118,10 @@ export function renderOverview(props: OverviewProps) {
|
||||
? html`<div style="margin-top: 6px">${t(copy.summaryKey)}</div>`
|
||||
: nothing}
|
||||
<div style="margin-top: 6px">
|
||||
<span class="mono">${approveCommand}</span><br />
|
||||
${pairingState.requestId
|
||||
? html`<span class="mono">openclaw devices approve ${pairingState.requestId}</span
|
||||
><br />`
|
||||
: nothing}
|
||||
<span class="mono">openclaw devices list</span>
|
||||
</div>
|
||||
<div style="margin-top: 6px; font-size: 12px;">${t("overview.pairing.mobileHint")}</div>
|
||||
|
||||
Reference in New Issue
Block a user