debug: add detailed logging to trace history loading

This commit is contained in:
Christian Vidal Wolf
2026-04-23 18:51:07 +02:00
parent 0eeeeb480c
commit be2adbfe68
2 changed files with 19 additions and 10 deletions
+6 -2
View File
@@ -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);
};