Implement final answer management in submission hook and storage utilities. Add functions to save, load, and clear final answers in localStorage. Update useSubmission hook to prioritize final answers over drafts, enhancing user experience during task submissions.
Some checks failed
platform/bro-js/challenge-pl/pipeline/head There was a failure building this commit
Some checks failed
platform/bro-js/challenge-pl/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
* Все ключи и операции в одном месте
|
||||
*/
|
||||
|
||||
import { clearAllFinalAnswers, listDrafts, clearDraft } from './drafts'
|
||||
|
||||
const isBrowser = () => typeof window !== 'undefined'
|
||||
|
||||
// Ключи localStorage
|
||||
@@ -107,6 +109,13 @@ export const storage = {
|
||||
|
||||
// Очищаем все прогрессы по цепочкам
|
||||
storage.clearAllChainProgress()
|
||||
|
||||
// Очищаем все финальные ответы
|
||||
clearAllFinalAnswers()
|
||||
|
||||
// Очищаем все черновики
|
||||
const drafts = listDrafts()
|
||||
drafts.forEach(taskId => clearDraft(taskId))
|
||||
},
|
||||
|
||||
// Очистка всех прогрессов по цепочкам
|
||||
|
||||
Reference in New Issue
Block a user