mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 02:47:10 +00:00
input hotfix
This commit is contained in:
@@ -44,6 +44,9 @@ const CompetitionSession = () => {
|
|||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
queryKey: ['solutionHistory', competitionId, taskId]
|
queryKey: ['solutionHistory', competitionId, taskId]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setAnswer("");
|
||||||
|
setSelectedFile(null);
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
console.error("Error submitting solution:", error);
|
console.error("Error submitting solution:", error);
|
||||||
|
|||||||
@@ -40,12 +40,9 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
|
|||||||
enabled: !!(competitionId && task.id),
|
enabled: !!(competitionId && task.id),
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get the solution history - already sorted from oldest to newest
|
|
||||||
const solutionHistory = solutionsQuery.data || [];
|
const solutionHistory = solutionsQuery.data || [];
|
||||||
|
|
||||||
// Handle task changes
|
// Handle task changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// If task changed, reset everything and load the latest solution
|
|
||||||
if (taskIdRef.current !== task.id) {
|
if (taskIdRef.current !== task.id) {
|
||||||
setCurrentSolution(null);
|
setCurrentSolution(null);
|
||||||
setSelectedSolutionUrl(null);
|
setSelectedSolutionUrl(null);
|
||||||
@@ -115,9 +112,6 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
|
|||||||
|
|
||||||
const handleSubmitWrapper = () => {
|
const handleSubmitWrapper = () => {
|
||||||
onSubmit();
|
onSubmit();
|
||||||
setAnswer("");
|
|
||||||
setSelectedFile(null);
|
|
||||||
setSelectedSolutionUrl(null);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user