escape some to_do

This commit is contained in:
Romulus21
2024-02-17 00:09:53 +01:00
parent e191c84f29
commit b53d378ec1
2 changed files with 4 additions and 4 deletions

View File

@@ -31,8 +31,8 @@ const Tracker = () => {
return <div>
{currentTimeTracker
? <div className="flex gap-2">
<Link to={`/todos/${currentTimeTracker?.to_do.id}`} className="font-bold">
{currentTimeTracker?.to_do.name}
<Link to={`/todos/${currentTimeTracker?.to_do?.id}`} className="font-bold">
{currentTimeTracker?.to_do?.name}
</Link>
<span>{timer}</span>
<button onClick={stopCurrentTimeTrack} className="flex items-center">

View File

@@ -34,9 +34,9 @@ const TimeTrackersIndex = () => {
{timeTrackers.map(tracker => <li key={tracker.id} className="flex justify-between gap-5">
<span className="text-center w-36">{tracker.start_at ? (new Date(tracker.start_at)).toSmallFrDate() : ''}</span>
<span className="text-center w-36">{(new Date(tracker.end_at)).toSmallFrDate()}</span>
<span className={`flex-1 ${tracker.to_do.checked ? 'line-through' : ''}`}>{tracker.to_do.name}</span>
<span className={`flex-1 ${tracker.to_do?.checked ? 'line-through' : ''}`}>{tracker.to_do.name}</span>
<span className="flex gap-2">
{!tracker?.to_do.checked && <button className="cursor-pointer w-7 justify-center flex items-center"
{!tracker?.to_do?.checked && <button className="cursor-pointer w-7 justify-center flex items-center"
type="button"
title="Commencer"
onClick={() => startTrackToDo(tracker.to_do)}>