linguabot commited on
Commit
d2d3db1
·
verified ·
1 Parent(s): 0e00d36

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. client/src/pages/TutorialTasks.tsx +18 -2
client/src/pages/TutorialTasks.tsx CHANGED
@@ -989,12 +989,28 @@ const TutorialTasks: React.FC = () => {
989
  requestAnimationFrame(() => setSpacerHeights(prev => ({ ...prev, [taskId]: 0 })));
990
  });
991
  } else {
992
- // Safari: delay refetch until after unlock to avoid visible reflow
 
993
  setTimeout(() => {
994
  api.get(`/api/submissions/by-source/${taskId}`).then(r => {
995
  const list = (r.data && r.data.submissions) || [];
996
  setUserSubmissions(prev => ({ ...prev, [taskId]: list }));
997
- }).catch(() => {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
998
  }, 300);
999
  }
1000
  });
 
989
  requestAnimationFrame(() => setSpacerHeights(prev => ({ ...prev, [taskId]: 0 })));
990
  });
991
  } else {
992
+ // Safari: delay refetch and keep locks until refetch completes
993
+ pendingUnlocksRef.current.add(taskId);
994
  setTimeout(() => {
995
  api.get(`/api/submissions/by-source/${taskId}`).then(r => {
996
  const list = (r.data && r.data.submissions) || [];
997
  setUserSubmissions(prev => ({ ...prev, [taskId]: list }));
998
+ requestAnimationFrame(() => {
999
+ unlockListHeight();
1000
+ unlockCardHeightById(taskId);
1001
+ unlockGridHeightById(taskId);
1002
+ unlockContainerHeightById(taskId);
1003
+ pendingUnlocksRef.current.delete(taskId);
1004
+ });
1005
+ }).catch(() => {
1006
+ requestAnimationFrame(() => {
1007
+ unlockListHeight();
1008
+ unlockCardHeightById(taskId);
1009
+ unlockGridHeightById(taskId);
1010
+ unlockContainerHeightById(taskId);
1011
+ pendingUnlocksRef.current.delete(taskId);
1012
+ });
1013
+ });
1014
  }, 300);
1015
  }
1016
  });