From d1af70f8e35358fcdc8f224ef9bf2de28d2887f4 Mon Sep 17 00:00:00 2001
From: Furkan Sahin <furkan-dev@proton.me>
Date: Tue, 31 May 2022 07:27:00 -0500
Subject: Adding/Deleting lab to/from PT marks it as assigned/unassigned

---
 src/components/EditorLists.svelte | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'src/components/EditorLists.svelte')

diff --git a/src/components/EditorLists.svelte b/src/components/EditorLists.svelte
index 3dda136..3ca6ecc 100644
--- a/src/components/EditorLists.svelte
+++ b/src/components/EditorLists.svelte
@@ -59,12 +59,20 @@
     selectedPeerTeacher?.labs.add(id);
     // Self assignemnt to update `assignedLabs` and `compatibleLabs`
     selectedPeerTeacher = selectedPeerTeacher;
+
+    // Mark lab as assigned
+    const lab = $labStore.get(id);
+    if (lab !== undefined) lab.assigned = true;
   }
 
   function unassignLab(id: number) {
     selectedPeerTeacher?.labs.delete(id);
     // Self assignemnt to update `assignedLabs` and `compatibleLabs`
     selectedPeerTeacher = selectedPeerTeacher;
+
+    // Mark lab as unassigned
+    const lab = $labStore.get(id);
+    if (lab !== undefined) lab.assigned = false;
   }
 </script>
 
-- 
cgit v1.2.3

