Skip to content

Commit

Permalink
client: Add more debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
jtojnar committed Jul 30, 2023
1 parent 2aef72e commit 4e6a3fc
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions client/js/templates/EntriesPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function entriesReducer(
state,
action,
) {
console.log(state, action)
switch (action.type) {
case LOAD_MORE:
const { entries } = action.payload;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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(() => {
Expand Down

0 comments on commit 4e6a3fc

Please sign in to comment.