Skip to content

Commit

Permalink
fix: Improovments on genLinkDeviceCodeForPhoneNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Jul 19, 2024
1 parent ebb247e commit 8c1c64b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/conn/functions/genLinkDeviceCodeForPhoneNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ export async function genLinkDeviceCodeForPhoneNumber(
phone: string,
sendPushNotification = true
): Promise<string> {
if (!phone || typeof phone !== 'string') {
throw new WPPError(
'send_the_phone_number_to_connect',
"Can't get code for without phone number param"
);
}
if (isAuthenticated()) {
throw new WPPError(
'cannot_get_code_for_already_authenticated',
Expand All @@ -44,7 +50,7 @@ export async function genLinkDeviceCodeForPhoneNumber(
}

await functions.initializeAltDeviceLinking();

console.log(phone, sendPushNotification);
return await functions.genLinkDeviceCodeForPhoneNumber(
phone,
sendPushNotification
Expand Down

0 comments on commit 8c1c64b

Please sign in to comment.