mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 15:55:24 +02:00
debug: add detailed logging to trace history loading
This commit is contained in:
@@ -21,19 +21,23 @@ export function HistoryView({ headers, data, onRevert, onEdit }: HistoryViewProp
|
||||
const [isFullscreen, setIsFullscreen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('[HistoryView] Mounting, data length:', data.length);
|
||||
loadHistory();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('[HistoryView] data changed, length:', data.length);
|
||||
if (data.length > 0) {
|
||||
loadHistory();
|
||||
}
|
||||
}, [data]);
|
||||
|
||||
const loadHistory = async () => {
|
||||
console.log('[HistoryView] loadHistory called');
|
||||
setLoading(true);
|
||||
const data = await getHistory();
|
||||
setHistory(data);
|
||||
const historyData = await getHistory();
|
||||
console.log('[HistoryView] getHistory returned:', historyData.length, 'entries', historyData[0]?.id === -1 || historyData[0]?.id === -2 ? '(ERROR)' : '');
|
||||
setHistory(historyData);
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user