Upload folder using huggingface_hub
Browse files
client/src/pages/TutorialTasks.tsx
CHANGED
|
@@ -1054,16 +1054,18 @@ const TutorialTasks: React.FC = () => {
|
|
| 1054 |
React.startTransition(() => {
|
| 1055 |
// Narrow refetch: only this task's submissions
|
| 1056 |
if (taskId) {
|
| 1057 |
-
|
| 1058 |
-
|
| 1059 |
-
|
| 1060 |
-
|
| 1061 |
-
|
| 1062 |
-
|
| 1063 |
-
|
| 1064 |
-
|
| 1065 |
-
|
| 1066 |
-
|
|
|
|
|
|
|
| 1067 |
} else {
|
| 1068 |
// Fallback
|
| 1069 |
requestAnimationFrame(() => requestAnimationFrame(() => fetchUserSubmissions(tutorialTasks)));
|
|
@@ -1084,7 +1086,18 @@ const TutorialTasks: React.FC = () => {
|
|
| 1084 |
unlockCardHeightById(taskId);
|
| 1085 |
unlockGridHeightById(taskId);
|
| 1086 |
}
|
| 1087 |
-
if (isSafari) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1088 |
setMutatingTaskId(null);
|
| 1089 |
}));
|
| 1090 |
};
|
|
|
|
| 1054 |
React.startTransition(() => {
|
| 1055 |
// Narrow refetch: only this task's submissions
|
| 1056 |
if (taskId) {
|
| 1057 |
+
if (!isSafari) {
|
| 1058 |
+
const gridEl = submissionsGridRefs.current[taskId];
|
| 1059 |
+
const gridHeight = gridEl ? gridEl.getBoundingClientRect().height : 0;
|
| 1060 |
+
if (gridHeight > 0) setSpacerHeights(prev => ({ ...prev, [taskId]: gridHeight }));
|
| 1061 |
+
api.get(`/api/submissions/by-source/${taskId}`).then(r => {
|
| 1062 |
+
const list = (r.data && r.data.submissions) || [];
|
| 1063 |
+
setUserSubmissions(prev => ({ ...prev, [taskId]: list }));
|
| 1064 |
+
requestAnimationFrame(() => setSpacerHeights(prev => ({ ...prev, [taskId]: 0 })));
|
| 1065 |
+
}).catch(() => {
|
| 1066 |
+
requestAnimationFrame(() => setSpacerHeights(prev => ({ ...prev, [taskId]: 0 })));
|
| 1067 |
+
});
|
| 1068 |
+
}
|
| 1069 |
} else {
|
| 1070 |
// Fallback
|
| 1071 |
requestAnimationFrame(() => requestAnimationFrame(() => fetchUserSubmissions(tutorialTasks)));
|
|
|
|
| 1086 |
unlockCardHeightById(taskId);
|
| 1087 |
unlockGridHeightById(taskId);
|
| 1088 |
}
|
| 1089 |
+
if (isSafari) {
|
| 1090 |
+
unfreezeScroll();
|
| 1091 |
+
// Safari: delay per-task refetch until after unlock to avoid visible reflow
|
| 1092 |
+
if (taskId) {
|
| 1093 |
+
setTimeout(() => {
|
| 1094 |
+
api.get(`/api/submissions/by-source/${taskId}`).then(r => {
|
| 1095 |
+
const list = (r.data && r.data.submissions) || [];
|
| 1096 |
+
setUserSubmissions(prev => ({ ...prev, [taskId]: list }));
|
| 1097 |
+
}).catch(() => {});
|
| 1098 |
+
}, 300);
|
| 1099 |
+
}
|
| 1100 |
+
}
|
| 1101 |
setMutatingTaskId(null);
|
| 1102 |
}));
|
| 1103 |
};
|