From 7de903a1846153ca486049d91fc3316edc654ef6 Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Thu, 23 Apr 2026 16:16:20 +0200 Subject: [PATCH] fix: load saved edits (status edited/pending) from Supabase --- src/App.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index bda71bc..58e08a5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -163,17 +163,17 @@ const articleNoIdx = resolvedCols.ARTICLE_NO; const articleNo = String(row[articleNoIdx]); const synced = syncedData[articleNo]; - // Start with fresh Dropbox values + // Start with fresh Dropbox values (prices from Excel) let finalRow = [...row]; - // Only use Supabase value if status is 'pending' (active edit session) - if (synced && synced.status === 'pending') { + // Load manual edits: status 'edited' = saved edits, 'pending' = unsaved edits + if (synced && (synced.status === 'edited' || synced.status === 'pending')) { editableColumns.forEach(idx => { if (synced.data[idx] !== undefined && synced.data[idx] !== null) { finalRow[idx] = synced.data[idx]; } }); - setRowStatuses(prev => ({ ...prev, [articleNo]: 'pending' })); + setRowStatuses(prev => ({ ...prev, [articleNo]: synced.status })); } return finalRow.map((val: any, idx: number) => {