Harden private media and backup recovery; add V2 deployment and migration guides
This commit is contained in:
parent
c549c34f60
commit
ffaa1f6afa
19 changed files with 623 additions and 14 deletions
|
|
@ -106,6 +106,10 @@ export default function SessionPage() {
|
|||
const back = attempt.quizId ? `/quizzes/${attempt.quizId}` : attempt.classId ? `/classes/${attempt.classId}` : '/';
|
||||
const exit = async () => {
|
||||
await flush();
|
||||
if (Object.keys(pending.current.answers).length > 0 || pending.current.flags !== undefined || pending.current.currentIndex !== undefined || pending.current.elapsedSec !== undefined) {
|
||||
toast.error('Your latest progress has not been saved. Stay here and retry when connected.');
|
||||
return;
|
||||
}
|
||||
void refresh();
|
||||
navigate(back);
|
||||
};
|
||||
|
|
@ -165,6 +169,9 @@ export default function SessionPage() {
|
|||
setFinishing(true);
|
||||
try {
|
||||
await flush();
|
||||
if (Object.keys(pending.current.answers).length > 0 || pending.current.flags !== undefined || pending.current.currentIndex !== undefined || pending.current.elapsedSec !== undefined) {
|
||||
throw new Error('Your latest progress has not been saved. Reconnect and submit again.');
|
||||
}
|
||||
const res = await api.post<{ attempt: Attempt }>(`/api/attempts/${attempt.id}/complete`, { elapsedSec });
|
||||
qc.setQueryData(qk.attempt(attempt.id), res.attempt);
|
||||
void refresh();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue