fix refresh conflict
This commit is contained in:
@@ -29,7 +29,7 @@ const Timetable = ({ user }) => {
|
||||
if (input.checked) {
|
||||
alert("Error: Conflict select");
|
||||
location.reload();
|
||||
return
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (const input of conflicts[target.name]) {
|
||||
@@ -149,7 +149,15 @@ const Timetable = ({ user }) => {
|
||||
} else {
|
||||
indexToElement[index].style.display = "";
|
||||
}
|
||||
indexToElement[index].checked = myselect.includes(index);
|
||||
const includes = myselect.includes(index);
|
||||
indexToElement[index].checked = includes;
|
||||
// after checked, find conflicts input
|
||||
if (includes) {
|
||||
for (const input of conflicts[index]) {
|
||||
console.log("conflict", input);
|
||||
input.setAttribute("disabled", "true");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
React.useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user