Skip to content

Commit e863fe8

Browse files
committed
fetch: Add quick comment about the implementation gap in fetch-needed.
This function can be confusing to look at right now because it takes a parameter it doesn't actually use, and which its name also refers to. That's because the current implementation doesn't quite match the intended interface; make a quick note of that for the reader.
1 parent a8d4d32 commit e863fe8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/message/fetchActions.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ const initialFetchComplete = (): Action => ({
106106
});
107107

108108
const isFetchNeededAtAnchor = (state: GlobalState, narrow: Narrow, anchor: number): boolean => {
109+
// Ideally this would detect whether, even if we don't have *all* the
110+
// messages in the narrow, we have enough of them around the anchor
111+
// to show a message list already. For now it's simple and cautious.
109112
const caughtUp = getCaughtUpForNarrow(state, narrow);
110113
return !(caughtUp.newer && caughtUp.older);
111114
};

0 commit comments

Comments
 (0)