mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:50:43 +00:00
chore: better explicit message on whatsapp
This commit is contained in:
@@ -142,7 +142,9 @@ describe("loginWeb coverage", () => {
|
||||
restartOpts?.onQr?.("restart-qr");
|
||||
await flushTasks();
|
||||
|
||||
expect(runtime.log).toHaveBeenCalledWith("Scan this QR in WhatsApp (Linked Devices):");
|
||||
expect(runtime.log).toHaveBeenCalledWith(
|
||||
"Open the WhatsApp app, go to Linked Devices, then scan this QR:",
|
||||
);
|
||||
expect(runtime.log).toHaveBeenCalledWith("terminal:initial-qr");
|
||||
expect(runtime.log).toHaveBeenCalledWith("terminal:restart-qr");
|
||||
expect(renderQrTerminalMock).toHaveBeenCalledWith("initial-qr", { small: true });
|
||||
|
||||
@@ -21,7 +21,7 @@ export async function loginWeb(
|
||||
const socketTiming = resolveWhatsAppSocketTiming(cfg);
|
||||
const restoredFromBackup = await restoreCredsFromBackupIfNeeded(account.authDir);
|
||||
const onQr = (qr: string) => {
|
||||
runtime.log("Scan this QR in WhatsApp (Linked Devices):");
|
||||
runtime.log("Open the WhatsApp app, go to Linked Devices, then scan this QR:");
|
||||
void renderQrTerminal(qr, { small: true })
|
||||
.then((output) => {
|
||||
runtime.log(output.endsWith("\n") ? output.slice(0, -1) : output);
|
||||
|
||||
@@ -192,7 +192,7 @@ export async function createWaSocket(
|
||||
if (qr) {
|
||||
opts.onQr?.(qr);
|
||||
if (printQr) {
|
||||
console.log("Scan this QR in WhatsApp (Linked Devices):");
|
||||
console.log("Open the WhatsApp app, go to Linked Devices, then scan this QR:");
|
||||
void printTerminalQr(qr).catch((err) => {
|
||||
sessionLogger.warn({ error: String(err) }, "failed rendering WhatsApp QR");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user