Show last 3 recently viewed tasks in navbar 馃晲
File: client/src/pages/Dashboard.jsx
No way to quickly jump back to a task
you were just looking at 馃拃 fr!!
Fix: save to localStorage on task click:
const handleSelectTask = (task) => {
const recent = JSON.parse(
localStorage.getItem('recent_tasks') || '[]'
)
const updated = [task,
...recent.filter(t => t._id !== task._id)
].slice(0, 3)
localStorage.setItem('recent_tasks', JSON.stringify(updated))
setSelectedTask(task)
}
Show in navbar as small clickable chips!
~12 lines! No backend needed 馃幆
Show last 3 recently viewed tasks in navbar 馃晲
File: client/src/pages/Dashboard.jsx
No way to quickly jump back to a task
you were just looking at 馃拃 fr!!
Fix: save to localStorage on task click:
const handleSelectTask = (task) => {
const recent = JSON.parse(
localStorage.getItem('recent_tasks') || '[]'
)
const updated = [task,
...recent.filter(t => t._id !== task._id)
].slice(0, 3)
localStorage.setItem('recent_tasks', JSON.stringify(updated))
setSelectedTask(task)
}
Show in navbar as small clickable chips!
~12 lines! No backend needed 馃幆