diff --git a/src/App.tsx b/src/App.tsx index 1a17d0f..76337b4 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -166,8 +166,9 @@ export default function App() { // Start with Dropbox values (default) let finalRow = [...row]; - // Only preserve Supabase values if there's a PENDING or EDITED edit for this article - if (synced && (synced.status === 'pending' || synced.status === 'edited' || synced.status === 'synced')) { + // Only preserve Supabase values if there's a PENDING manual edit + // NOT for 'synced' status - we want fresh Dropbox data to overwrite + if (synced && synced.status === 'pending') { // DETECT COLUMN SHIFT: If the saved data uses the old structure (where index 12 was a numeric date), // we need to shift all indices from 12 onwards by +1 to match today's Excel structure. const oldData = synced.data; @@ -186,9 +187,9 @@ export default function App() { finalRow[idx] = oldData[mergeIdx]; } }); - setRowStatuses(prev => ({ ...prev, [articleNo]: 'synced' })); + setRowStatuses(prev => ({ ...prev, [articleNo]: synced.status })); } - // Otherwise use Dropbox values (don't merge, just process formatting) + // Otherwise use Dropbox values (default - will show 4.5 not 4.95) return finalRow.map((val: any, idx: number) => { if (val === undefined || val === null || val === '') return val;