Remember if the Attendance is open

This commit is contained in:
Tanner Collin 2020-10-05 21:13:55 +00:00
parent d5b8ffa0e2
commit 2ff436eef5

View File

@ -130,9 +130,11 @@ function AttendanceRow(props) {
);
}
let attendanceOpenCache = false;
export function InstructorClassAttendance(props) {
const { clazz, token, refreshClass, user } = props;
const [open, setOpen] = useState(false);
const [open, setOpen] = useState(attendanceOpenCache);
const [input, setInput] = useState({});
const [error, setError] = useState(false);
const [loading, setLoading] = useState(false);
@ -213,7 +215,7 @@ export function InstructorClassAttendance(props) {
</Form>
</div>
:
<Button onClick={() => setOpen(true)}>
<Button onClick={() => {setOpen(true); attendanceOpenCache = true;}}>
Edit Attendance
</Button>
}