Skip to content

Commit

Permalink
feat(date) fix consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindgrutle committed Sep 11, 2023
1 parent c0df628 commit cf42282
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion next-tavla/src/Shared/hooks/useUpdateLastActive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ function useUpdateLastActive(documentId: string) {
const settings = await getBoardSettings(documentId)
const lastActive = settings.meta?.lastActive ?? 0
const lastActiveDate = new Date(lastActive)
if (Date.now() - lastActiveDate.getTime() > 1000 * 60 * 60 * 24) {
if (
new Date().getTime() - lastActiveDate.getTime() >
1000 * 60 * 60 * 24
) {
await fetch(`/api/ping`, {
method: 'POST',
headers: {
Expand Down

0 comments on commit cf42282

Please sign in to comment.