diff --git a/src/message/__tests__/fetchActions-test.js b/src/message/__tests__/fetchActions-test.js index 5cc8a80860..e7d615dff6 100644 --- a/src/message/__tests__/fetchActions-test.js +++ b/src/message/__tests__/fetchActions-test.js @@ -566,12 +566,12 @@ describe('fetchActions', () => { expect(actions).toHaveLength(0); }); - test('when needsInitialFetch is true, no action is dispatched', async () => { + test('when loading is true, no action is dispatched', async () => { const store = mockStore({ ...baseState, session: { ...baseState.session, - needsInitialFetch: true, + loading: true, }, }); @@ -658,12 +658,12 @@ describe('fetchActions', () => { expect(actions).toHaveLength(0); }); - test('when needsInitialFetch is true, no action is dispatched', async () => { + test('when loading is true, no action is dispatched', async () => { const store = mockStore({ ...baseState, session: { ...baseState.session, - needsInitialFetch: true, + loading: true, }, }); diff --git a/src/message/fetchActions.js b/src/message/fetchActions.js index 96cbd88a63..d4ebae280f 100644 --- a/src/message/fetchActions.js +++ b/src/message/fetchActions.js @@ -160,9 +160,9 @@ export const fetchOlder = (narrow: Narrow): ThunkAction => (dispatch, getS const firstMessageId = getFirstMessageId(state, narrow); const caughtUp = getCaughtUpForNarrow(state, narrow); const fetching = getFetchingForNarrow(state, narrow); - const { needsInitialFetch } = getSession(state); + const { loading } = getSession(state); - if (!needsInitialFetch && !fetching.older && !caughtUp.older && firstMessageId !== undefined) { + if (!loading && !fetching.older && !caughtUp.older && firstMessageId !== undefined) { dispatch( fetchMessages({ narrow, @@ -179,9 +179,9 @@ export const fetchNewer = (narrow: Narrow): ThunkAction => (dispatch, getS const lastMessageId = getLastMessageId(state, narrow); const caughtUp = getCaughtUpForNarrow(state, narrow); const fetching = getFetchingForNarrow(state, narrow); - const { needsInitialFetch } = getSession(state); + const { loading } = getSession(state); - if (!needsInitialFetch && !fetching.newer && !caughtUp.newer && lastMessageId !== undefined) { + if (!loading && !fetching.newer && !caughtUp.newer && lastMessageId !== undefined) { dispatch( fetchMessages({ narrow,