mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 12:25:22 +02:00
fix: resolve white screen by removing stack-unfriendly spread operators and adding diagnostic logs
This commit is contained in:
@@ -554,7 +554,7 @@ const DataGrid: React.FC<DataGridProps> = ({ data, filters, hasCustomerFilter, a
|
||||
// 2. Sort
|
||||
if (sortConfig.key) {
|
||||
// Create a copy to avoid mutating the original array and ensure React detects the change
|
||||
result = [...result].sort((a, b) => {
|
||||
result = result.slice().sort((a, b) => {
|
||||
let valA: number | string = '';
|
||||
let valB: number | string = '';
|
||||
|
||||
@@ -611,7 +611,7 @@ const DataGrid: React.FC<DataGridProps> = ({ data, filters, hasCustomerFilter, a
|
||||
} else if (showOnlyTop50 && top50Ranking) {
|
||||
// Default sort by Rank when Top 50 is active
|
||||
const rankMap = top50Mode === 'eu' ? top50Ranking.eu : top50Ranking.uk;
|
||||
result = [...result].sort((a, b) => {
|
||||
result = result.slice().sort((a, b) => {
|
||||
const rankA = a.asin ? rankMap.get(a.asin.toUpperCase()) || 999 : 999;
|
||||
const rankB = b.asin ? rankMap.get(b.asin.toUpperCase()) || 999 : 999;
|
||||
return rankA - rankB;
|
||||
|
||||
Reference in New Issue
Block a user