Skip to content

Commit 841eb81

Browse files
committed
chore: better explicit message on whatsapp
1 parent fc7e2a1 commit 841eb81

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

extensions/whatsapp/src/login.coverage.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ describe("loginWeb coverage", () => {
142142
restartOpts?.onQr?.("restart-qr");
143143
await flushTasks();
144144

145-
expect(runtime.log).toHaveBeenCalledWith("Scan this QR in WhatsApp (Linked Devices):");
145+
expect(runtime.log).toHaveBeenCalledWith(
146+
"Open the WhatsApp app, go to Linked Devices, then scan this QR:",
147+
);
146148
expect(runtime.log).toHaveBeenCalledWith("terminal:initial-qr");
147149
expect(runtime.log).toHaveBeenCalledWith("terminal:restart-qr");
148150
expect(renderQrTerminalMock).toHaveBeenCalledWith("initial-qr", { small: true });

extensions/whatsapp/src/login.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export async function loginWeb(
2121
const socketTiming = resolveWhatsAppSocketTiming(cfg);
2222
const restoredFromBackup = await restoreCredsFromBackupIfNeeded(account.authDir);
2323
const onQr = (qr: string) => {
24-
runtime.log("Scan this QR in WhatsApp (Linked Devices):");
24+
runtime.log("Open the WhatsApp app, go to Linked Devices, then scan this QR:");
2525
void renderQrTerminal(qr, { small: true })
2626
.then((output) => {
2727
runtime.log(output.endsWith("\n") ? output.slice(0, -1) : output);

extensions/whatsapp/src/session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export async function createWaSocket(
192192
if (qr) {
193193
opts.onQr?.(qr);
194194
if (printQr) {
195-
console.log("Scan this QR in WhatsApp (Linked Devices):");
195+
console.log("Open the WhatsApp app, go to Linked Devices, then scan this QR:");
196196
void printTerminalQr(qr).catch((err) => {
197197
sessionLogger.warn({ error: String(err) }, "failed rendering WhatsApp QR");
198198
});

0 commit comments

Comments
 (0)