Skip to content

Show "Last visited X ago" on board load 🕐 #518

Description

@anoopcodehack

Show "Last visited X ago" on board load 🕐

File: client/src/pages/Dashboard.jsx

No record of when you last opened
the board 💀 fr!!

Fix:
const [lastVisit, setLastVisit] = useState(
localStorage.getItem('last_visit')
)

useEffect(() => {
localStorage.setItem('last_visit',
new Date().toISOString())
}, [])

{lastVisit && (

Last visit: {timeAgo(lastVisit)}

)}

timeAgo function already exists ✅
~8 lines! No backend needed 🎯

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions