Upload folder using huggingface_hub
Browse files
client/src/pages/TutorialTasks.tsx
CHANGED
|
@@ -323,7 +323,7 @@ const TutorialTasks: React.FC = () => {
|
|
| 323 |
// throttle fetch during and just after mutations to avoid reflow interference
|
| 324 |
if (mutatingTaskId) {
|
| 325 |
try { console.log('[Trace] Docs:skipDuringMutate', { weekNumber, mutatingTaskId }); } catch {}
|
| 326 |
-
setTimeout(() => { if (!mutatingTaskId) loadDocs(); },
|
| 327 |
return;
|
| 328 |
}
|
| 329 |
if (isDocsFetchInFlightRef.current) {
|
|
@@ -1146,27 +1146,33 @@ const TutorialTasks: React.FC = () => {
|
|
| 1146 |
}
|
| 1147 |
// let DOM settle then unlock (both list and card if id known)
|
| 1148 |
requestAnimationFrame(() => requestAnimationFrame(() => {
|
| 1149 |
-
|
| 1150 |
-
|
| 1151 |
-
|
| 1152 |
-
|
| 1153 |
-
|
| 1154 |
-
|
| 1155 |
-
|
| 1156 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1157 |
if (taskId) {
|
| 1158 |
-
|
| 1159 |
-
|
| 1160 |
-
const list = (r.data && r.data.submissions) || [];
|
| 1161 |
-
setUserSubmissions(prev => ({ ...prev, [taskId]: list }));
|
| 1162 |
-
try {
|
| 1163 |
-
const el = cardRefs.current[taskId];
|
| 1164 |
-
const topAfter = el ? el.getBoundingClientRect().top : null;
|
| 1165 |
-
console.log('[Trace] ScrollPreserve(del):after', { taskId, topAfter });
|
| 1166 |
-
} catch {}
|
| 1167 |
-
}).catch(() => {});
|
| 1168 |
-
}, 300);
|
| 1169 |
}
|
|
|
|
| 1170 |
}
|
| 1171 |
setMutatingTaskId(null);
|
| 1172 |
}));
|
|
|
|
| 323 |
// throttle fetch during and just after mutations to avoid reflow interference
|
| 324 |
if (mutatingTaskId) {
|
| 325 |
try { console.log('[Trace] Docs:skipDuringMutate', { weekNumber, mutatingTaskId }); } catch {}
|
| 326 |
+
setTimeout(() => { if (!mutatingTaskId) loadDocs(); }, 600);
|
| 327 |
return;
|
| 328 |
}
|
| 329 |
if (isDocsFetchInFlightRef.current) {
|
|
|
|
| 1146 |
}
|
| 1147 |
// let DOM settle then unlock (both list and card if id known)
|
| 1148 |
requestAnimationFrame(() => requestAnimationFrame(() => {
|
| 1149 |
+
if (isSafari && taskId) {
|
| 1150 |
+
// Hold locks until per-task refetch completes
|
| 1151 |
+
pendingUnlocksRef.current.add(taskId);
|
| 1152 |
+
setTimeout(() => {
|
| 1153 |
+
api.get(`/api/submissions/by-source/${taskId}`).then(r => {
|
| 1154 |
+
const list = (r.data && r.data.submissions) || [];
|
| 1155 |
+
setUserSubmissions(prev => ({ ...prev, [taskId]: list }));
|
| 1156 |
+
}).catch(() => {}).finally(() => {
|
| 1157 |
+
unlockListHeight();
|
| 1158 |
+
unlockCardHeightById(taskId);
|
| 1159 |
+
unlockGridHeightById(taskId);
|
| 1160 |
+
if (SAFARI_FREEZE_ENABLED) unfreezeScroll();
|
| 1161 |
+
pendingUnlocksRef.current.delete(taskId);
|
| 1162 |
+
try {
|
| 1163 |
+
const el = cardRefs.current[taskId];
|
| 1164 |
+
const topAfter = el ? el.getBoundingClientRect().top : null;
|
| 1165 |
+
console.log('[Trace] ScrollPreserve(del):after', { taskId, topAfter });
|
| 1166 |
+
} catch {}
|
| 1167 |
+
});
|
| 1168 |
+
}, 300);
|
| 1169 |
+
} else {
|
| 1170 |
+
unlockListHeight();
|
| 1171 |
if (taskId) {
|
| 1172 |
+
unlockCardHeightById(taskId);
|
| 1173 |
+
unlockGridHeightById(taskId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1174 |
}
|
| 1175 |
+
if (isSafari && SAFARI_FREEZE_ENABLED) { unfreezeScroll(); }
|
| 1176 |
}
|
| 1177 |
setMutatingTaskId(null);
|
| 1178 |
}));
|