From 8d310f99e82f2c9b573e4246058f3a77ca5fe8c8 Mon Sep 17 00:00:00 2001 From: agastya gaur Date: Thu, 26 Dec 2024 13:15:09 +0530 Subject: [PATCH] add online status for authenticated user to true --- src/Utils/utils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Utils/utils.ts b/src/Utils/utils.ts index f9e0e14577a..2a07ae3f195 100644 --- a/src/Utils/utils.ts +++ b/src/Utils/utils.ts @@ -217,7 +217,11 @@ export const formatCurrency = (price: number) => currency: "INR", }); -export const isUserOnline = (user: { last_login: DateLike }) => { +export const isUserOnline = (user: { + last_login: DateLike; + isAuthenticated?: boolean; +}) => { + if (user.isAuthenticated) return true; return user.last_login ? dayjs().subtract(5, "minutes").isBefore(user.last_login) : false;