geo detection
This commit is contained in:
@@ -1118,10 +1118,10 @@ export class NotificationService {
|
||||
|
||||
const lastMessageTime = new Date(result.rows[0].created_at);
|
||||
const now = new Date();
|
||||
const hoursSinceLastMessage = (now.getTime() - lastMessageTime.getTime()) / (1000 * 60 * 60);
|
||||
const secondsSinceLastMessage = (now.getTime() - lastMessageTime.getTime()) / 1000;
|
||||
|
||||
// Считаем активным если последнее сообщение было менее 10 минут назад
|
||||
return hoursSinceLastMessage < (10 / 60);
|
||||
// Считаем активным если последнее сообщение было менее 30 секунд назад
|
||||
return secondsSinceLastMessage < 30;
|
||||
} catch (error) {
|
||||
console.error('Error checking user activity:', error);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user