From 50f1a033cb389a2f92bef89042f27a9e64b9ca5c Mon Sep 17 00:00:00 2001 From: James Birnie Date: Wed, 2 Apr 2025 13:49:04 -0700 Subject: [PATCH] fixedLockUnlock --- frontend/react-app/src/components/LockUnlockTask.jsx | 2 ++ frontend/react-app/src/pages/MyTasks.jsx | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/react-app/src/components/LockUnlockTask.jsx b/frontend/react-app/src/components/LockUnlockTask.jsx index a5ba4d2..af7ffa2 100644 --- a/frontend/react-app/src/components/LockUnlockTask.jsx +++ b/frontend/react-app/src/components/LockUnlockTask.jsx @@ -12,11 +12,13 @@ function LockUnlockTask({ initialIsLocked, taskId }) { const unlock = await unlockTask(taskId); if (unlock) { setIsLocked(false); + window.location.reload(); } } else { const lock = await lockTask(taskId); if (lock) { setIsLocked(true); + window.location.reload(); } } } catch (error) { diff --git a/frontend/react-app/src/pages/MyTasks.jsx b/frontend/react-app/src/pages/MyTasks.jsx index 721cc37..b30ffaa 100644 --- a/frontend/react-app/src/pages/MyTasks.jsx +++ b/frontend/react-app/src/pages/MyTasks.jsx @@ -32,7 +32,7 @@ function mapTaskItem(taskItem) { ...baseItem, status: taskItem.status, priority: taskItem.priority, - isLocked: taskItem.isLocked.toString() + isLocked: !!taskItem.isLocked }; }); @@ -124,11 +124,7 @@ const headerAndAccessors = [ return isAdmin ? ( ) : ( - isLocked ? ( - - ) : ( - - ) + isLocked ? '🔒' : '🔓' ); }, }