Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add online status for authenticated user to true #9573

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add online status for authenticated user to true
  • Loading branch information
Agastya18 committed Dec 26, 2024
commit 8d310f99e82f2c9b573e4246058f3a77ca5fe8c8
6 changes: 5 additions & 1 deletion src/Utils/utils.ts
Original file line number Diff line number Diff line change
@@ -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;
Loading