refactor: Remove current_date arg from last_seen_status_from_date.

The current_date argument was only used in tests and now we're using
and now we're using MockDate in tests.
This commit is contained in:
Shubham Padia
2024-01-15 14:01:32 +07:00
committed by Tim Abbott
parent d5de26ff3b
commit 3d2110be51
2 changed files with 7 additions and 4 deletions

View File

@@ -256,10 +256,8 @@ export function relative_time_string_from_date(date: Date): string {
// word order.
//
// Current date is passed as an argument for unit testing
export function last_seen_status_from_date(
last_active_date: Date,
current_date = new Date(),
): string {
export function last_seen_status_from_date(last_active_date: Date): string {
const current_date = new Date();
const minutes = differenceInMinutes(current_date, last_active_date);
if (minutes < 60) {
return $t({defaultMessage: "Active {minutes} minutes ago"}, {minutes});