mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-22 23:17:09 +00:00
minor fixes
This commit is contained in:
@@ -74,7 +74,11 @@ const TaskContent: React.FC<TaskContentProps> = ({ task }) => {
|
|||||||
const getFileNameFromUrl = (url: string): string => {
|
const getFileNameFromUrl = (url: string): string => {
|
||||||
try {
|
try {
|
||||||
const parts = url.split('/');
|
const parts = url.split('/');
|
||||||
return parts[parts.length - 1];
|
const fullFileName = parts[parts.length - 1]
|
||||||
|
const fileName = fullFileName.length > 20
|
||||||
|
? fullFileName.substring(0, 20) + '...'
|
||||||
|
: fullFileName;
|
||||||
|
return fileName;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return 'Файл';
|
return 'Файл';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
|
|||||||
const maxAttempts = task.max_attempts || -1;
|
const maxAttempts = task.max_attempts || -1;
|
||||||
const submissionsUsed = solutionHistory.length;
|
const submissionsUsed = solutionHistory.length;
|
||||||
const submissionsLeft = Math.max(0, maxAttempts - submissionsUsed);
|
const submissionsLeft = Math.max(0, maxAttempts - submissionsUsed);
|
||||||
const hasSubmissionsLeft = submissionsLeft > 0;
|
const hasSubmissionsLeft = submissionsLeft > 0 || maxAttempts === -1;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (solutionHistory.length > 0 && !displayedSolution) {
|
if (solutionHistory.length > 0 && !displayedSolution) {
|
||||||
|
|||||||
Reference in New Issue
Block a user