aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2022-05-31 07:18:41 -0500
committerFurkan Sahin <furkan-dev@proton.me>2022-05-31 07:18:41 -0500
commit6ef793f5593bb88d1bbf716a396cb5ab1022afb5 (patch)
treed53685b6c034705ed77a77b103d488227679c2aa /src/components
parent3339718df21e49197b4de7105852f14e6e0550b1 (diff)
Instead of checking whether a lab is self-assigned, check whether the lab is assigned to any PT at all!
Diffstat (limited to 'src/components')
-rw-r--r--src/components/EditorLists.svelte5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/components/EditorLists.svelte b/src/components/EditorLists.svelte
index 1b2084a..7cd17f6 100644
--- a/src/components/EditorLists.svelte
+++ b/src/components/EditorLists.svelte
@@ -29,8 +29,11 @@
$: compatibleLabs = labs.filter(
(lab) =>
- !selectedPeerTeacher?.labs.has(lab.id) &&
+ // Lab not already assigned
+ !lab.assigned &&
+ // PT schedule not conflict with lab
!selectedPeerTeacher?.conflictsWith(lab.event) &&
+ // PT's labs not conflict with this lab
!assignedLabs.some((assignment) =>
assignment.event.conflictsWith(lab.event)
)