You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/tx/[id]/transaction-details-ui.tsx
+38-21Lines changed: 38 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -382,22 +382,31 @@ function ActivityLogCard({
382
382
}: {
383
383
activityLogs: ActivityLogEntry[];
384
384
}){
385
-
// Sort activity logs and prepare JSX elements using for...of loop
385
+
// Sort activity logs and prepare JSX elements using pure for...of loops
386
386
constrenderActivityLogs=()=>{
387
-
if(activityLogs.length===0){
387
+
// Check if activity logs is empty using for...of loop
388
+
lethasAnyLogs=false;
389
+
for(const_logofactivityLogs){
390
+
hasAnyLogs=true;
391
+
break;
392
+
}
393
+
394
+
if(!hasAnyLogs){
388
395
return(
389
396
<pclassName="text-muted-foreground text-sm">
390
397
No activity logs available for this transaction
391
398
</p>
392
399
);
393
400
}
394
401
395
-
// Sort logs chronologically using for...of loop (manual sorting)
402
+
// Sort logs chronologically using pure for...of loops (manual sorting)
396
403
constsortedLogs: ActivityLogEntry[]=[];
404
+
letsortedLogsCount=0;
397
405
398
-
// Copy all logs to sortedLogs first
406
+
// Copy all logs to sortedLogs first using manual counting
399
407
for(constlogofactivityLogs){
400
-
sortedLogs[sortedLogs.length]=log;
408
+
sortedLogs[sortedLogsCount]=log;
409
+
sortedLogsCount++;
401
410
}
402
411
403
412
// Manual bubble sort using only for...of loops with manual index tracking
@@ -409,31 +418,39 @@ function ActivityLogCard({
409
418
letcurrentIndex=0;
410
419
411
420
for(constlogofsortedLogs){
412
-
if(
413
-
prevLog&&
414
-
newDate(prevLog.createdAt).getTime()>
415
-
newDate(log.createdAt).getTime()
416
-
){
417
-
// Swap elements using manual assignment
418
-
sortedLogs[prevIndex]=log;
419
-
sortedLogs[currentIndex]=prevLog;
420
-
sortingComplete=false;
421
+
// Only process valid logs (skip undefined entries)
0 commit comments