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

This commit is contained in:
2025-12-14 14:17:30 +03:00
parent f4e85fe980
commit cbf411cd54
3 changed files with 60 additions and 4 deletions

View File

@@ -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))
},
// Очистка всех прогрессов по цепочкам