This commit is contained in:
rngsurrounded
2025-03-03 20:19:43 +09:00
parent 3ef70b770f
commit 404ca1cc59
3 changed files with 1 additions and 13 deletions
@@ -42,7 +42,6 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
const solutionHistory = solutionsQuery.data || [];
// Set initial solution to the last one (most recent) when solutions are loaded
useEffect(() => {
if (solutionHistory.length > 0 && !displayedSolution) {
const latestSolution = solutionHistory[solutionHistory.length - 1];
@@ -50,10 +49,8 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
}
}, [solutionHistory, displayedSolution]);
// When task changes, reset everything and load the latest solution for the new task
useEffect(() => {
if (prevTaskIdRef.current !== task.id) {
// Reset states for new task
setDisplayedSolution(null);
setSelectedSolutionUrl(null);