From 4e6a3fc47ab0fdfaed695f24b08861cb18040cc9 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 30 Jul 2023 10:36:27 +0200 Subject: [PATCH] client: Add more debugging --- client/js/templates/EntriesPage.jsx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/client/js/templates/EntriesPage.jsx b/client/js/templates/EntriesPage.jsx index d19697565e..bc05fdd1fe 100644 --- a/client/js/templates/EntriesPage.jsx +++ b/client/js/templates/EntriesPage.jsx @@ -33,6 +33,7 @@ function entriesReducer( state, action, ) { + console.log(state, action) switch (action.type) { case LOAD_MORE: const { entries } = action.payload; @@ -109,14 +110,25 @@ function reloadList({ selfoss.entriesPage.setSelectedEntry(null); } + const reloader_ = reloader; + + reloader = (...args) => { + const r = reloader_(...args); + console.trace('reloader', r); + return r; + } + setLoadingState(LoadingState.LOADING); return reloader(fetchParams, abortController).then(({ entries, hasMore }) => { setLoadingState(LoadingState.SUCCESS); - selfoss.entriesPage.setHasMore(hasMore); + console.trace('reloader-then', abortController.signal, abortController.signal.aborted); if (abortController.signal.aborted) { return; } + console.log('after') + + selfoss.entriesPage.setHasMore(hasMore); if (append) { selfoss.entriesPage.appendEntries(entries); @@ -284,7 +296,11 @@ export function EntriesPage({ return navSourcesExpanded; }, [params.filter, currentTag, currentSource, searchText]); - const [moreLoadingState, setMoreLoadingState] = useState(LoadingState.INITIAL); + const [moreLoadingState, setMoreLoadingState_] = useState(LoadingState.INITIAL); + const setMoreLoadingState = (...args) => { + console.trace('moreState', ...args); + setMoreLoadingState_(...args); + }; // Perform the scheduled reload. useEffect(() => {