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) => {