From 985fd3b94d9a083eed852e83166a14f0b103a0ef Mon Sep 17 00:00:00 2001 From: Bob <115008575+bobslavtriev@users.noreply.github.com> Date: Fri, 19 Jan 2024 13:01:32 -0300 Subject: [PATCH] Update getDevice (#569) Co-authored-by: Bob <115008575+bobpetrov@users.noreply.github.com> --- src/Utils/messages.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Utils/messages.ts b/src/Utils/messages.ts index 5fd2591..0d2f1c8 100644 --- a/src/Utils/messages.ts +++ b/src/Utils/messages.ts @@ -738,7 +738,7 @@ export const extractMessageContent = (content: WAMessageContent | undefined | nu /** * Returns the device predicted by message ID */ -export const getDevice = (id: string) => /^3A/.test(id) ? 'ios' : /^3E/.test(id) ? 'web' : /^.{21}/.test(id) ? 'android' : /^.{18}/.test(id) ? 'desktop' : 'unknown' +export const getDevice = (id: string) => /^3A.{18}$/.test(id) ? 'ios' : /^3E.{20}$/.test(id) ? 'web' : /^(.{21}|.{32})$/.test(id) ? 'android' : /^.{18}$/.test(id) ? 'desktop' : 'unknown' /** Upserts a receipt in the message */ export const updateMessageWithReceipt = (msg: Pick, receipt: MessageUserReceipt) => {