Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

fix(pairing): say "1 d ago" instead of "24 h ago"

afinitus6fc6ce586f6f
diff --git a/src/lib/pairing-time.ts b/src/lib/pairing-time.ts
index 142dec54e3..740f5f7e8f 100644
--- a/src/lib/pairing-time.ts
+++ b/src/lib/pairing-time.ts
@@ -10,6 +10,8 @@ export function lastSeen(lastSeenAt: number, now = Date.now()): string {
const minutes = Math.max(0, Math.floor((now - lastSeenAt) / 60_000));
if (minutes < 1) return t("remote.serverPairing.justNow");
if (minutes < 60) return t("remote.serverPairing.minutesAgo", { minutes });
- if (minutes < 1440) return t("remote.serverPairing.hoursAgo", { hours: Math.round(minutes / 60) });
+ // Compare the rounded hours, so 23.5 h and up reads "1 d ago", never "24 h ago".
+ const hours = Math.round(minutes / 60);
+ if (hours < 24) return t("remote.serverPairing.hoursAgo", { hours });
return t("remote.serverPairing.daysAgo", { days: Math.round(minutes / 1440) });
}