Skip to content

Commit 091d9ed

Browse files
committed
register: Dispatch REGISTER_START just before we start /register.
With the goal that REGISTER_START and REGISTER_COMPLETE are tight bookends around the code responsible for making the /register request. We hope this is NFC; the only cases where it wouldn't be are when `getAuth` and/or `getHaveServerData` throw an error. `getAuth` would be the natural one to worry about, but we really don't expect `doInitialFetch` to be called unless we have an active, logged-in account.
1 parent da10cad commit 091d9ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/message/fetchActions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,11 +448,11 @@ export async function tryFetch<T>(
448448
* (`SearchMessagesScreen`).
449449
*/
450450
export const doInitialFetch = (): ThunkAction<Promise<void>> => async (dispatch, getState) => {
451-
dispatch(registerStart());
452451
const auth = getAuth(getState());
453452

454453
const haveServerData = getHaveServerData(getState());
455454

455+
dispatch(registerStart());
456456
let initData: InitialData;
457457
try {
458458
initData = await tryFetch(

0 commit comments

Comments
 (0)